Serenity BDD - Firefox alert box closes automatically. Unable to detect the alert

738 views
Skip to first unread message

Jatin Kaushik

unread,
Dec 6, 2016, 2:11:25 AM12/6/16
to Serenity BDD Users Group

**

[main] ERROR net.serenitybdd.core.Serenity - No alert is present (WARNING: The server did not provide any stacktrace information)

**

My Question is exactly similar to this one "Firefox alert box not detected with Selenium WebDriver"

But I am not able to find the solution.Even I have tried all kind of waits, changed firefox versions & tried the solution mentioned in the shared link. But, either I am not able to implement it or its not working.

So, guys need urgent help this is the only thing blocking me with my automation project.

Issue: When doing this task manually pop up comes up when I click on update button & its working fine.

But, when i do same action using automation pop-up shows & immediately closes automatically within a fraction of seconds & serenity throws error that No Alert not found. Also, alert window that appears during automation is bit different than the one found during manual execution. Please, refer to the link shared above if you want to see the difference in windows.

  public void i_click_update_button() throws InterruptedException {
    btn_update.waitUntilClickable().click(); // clicks the button & pop-up comes
  }      

  public void Accept_POP_UP() throws InterruptedException {

    getAlert().accept(); // code to accept the alret. I have already tried implementing wait & everything. problem is pop-up comes & immediately closes automatically
}

Please, guys need help..! First time posting a question..!! Thanks in advance..!!

Saunak Tarafdar

unread,
Dec 6, 2016, 8:33:24 PM12/6/16
to Serenity BDD Users Group
I am also facing exactly the same problem. Any help around this would be highly appreciated

Jatin Kaushik

unread,
Dec 7, 2016, 1:26:39 AM12/7/16
to Serenity BDD Users Group
Hi Guys,

Anyone...any suggestions..!!

FF version is 46 & Selenium jar is 2.53..!!


On Tuesday, December 6, 2016 at 12:41:25 PM UTC+5:30, Jatin Kaushik wrote:

John Smart

unread,
Dec 7, 2016, 1:41:18 AM12/7/16
to Jatin Kaushik, Serenity BDD Users Group
Does it happen if you use Chrome instead?

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-users+unsubscribe@googlegroups.com.
To post to this group, send email to thucydides-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
___________________________________________________
John Smart | Wakaleo Consulting  |  +44 7398 832273
Making smart teams collaborate better
http://johnfergusonsmart.com  |  john....@wakaleo.com
___________________________________________________

We love breaking down silos and helping smart teams collaborate better! Ask about our tailored on-site workshops in Agile Product Planning, BDD Requirements Discovery,  BDD, TDD and Clean Coding, and Advanced BDD Test Automation.
___________________________________________________

Jatin Kaushik

unread,
Dec 7, 2016, 1:54:40 AM12/7/16
to Serenity BDD Users Group, jatin...@gmail.com
Hi John,
Thanks for the response..!! We are not allowed to use Chrome Browser in our office machines..!!
And, website works internally when connected to my office Network..!! So, can't test on chrome..!! 

It's a very strange behavior....when doing manually pop-up comes & waits for the response but when running same steps with Scripts pop-up just flashes for a sec & then just goes away..!! It didn't give selenium a chance to detect it..!! :( 

Anyway, by which we can accept it automatically or any way to stop it from getting dismissed?? 

Note: I have tried all kind of waits, sleeps..even tried serenity.driver.capabilities for unexpectedalert to ignore & accept..!!

On Wednesday, December 7, 2016 at 12:11:18 PM UTC+5:30, John Smart wrote:
Does it happen if you use Chrome instead?
On 7 December 2016 at 06:26, Jatin Kaushik <jatin...@gmail.com> wrote:
Hi Guys,

Anyone...any suggestions..!!

FF version is 46 & Selenium jar is 2.53..!!

On Tuesday, December 6, 2016 at 12:41:25 PM UTC+5:30, Jatin Kaushik wrote:

**

[main] ERROR net.serenitybdd.core.Serenity - No alert is present (WARNING: The server did not provide any stacktrace information)

**

My Question is exactly similar to this one "Firefox alert box not detected with Selenium WebDriver"

But I am not able to find the solution.Even I have tried all kind of waits, changed firefox versions & tried the solution mentioned in the shared link. But, either I am not able to implement it or its not working.

So, guys need urgent help this is the only thing blocking me with my automation project.

Issue: When doing this task manually pop up comes up when I click on update button & its working fine.

But, when i do same action using automation pop-up shows & immediately closes automatically within a fraction of seconds & serenity throws error that No Alert not found. Also, alert window that appears during automation is bit different than the one found during manual execution. Please, refer to the link shared above if you want to see the difference in windows.

  public void i_click_update_button() throws InterruptedException {
    btn_update.waitUntilClickable().click(); // clicks the button & pop-up comes
  }      

  public void Accept_POP_UP() throws InterruptedException {

    getAlert().accept(); // code to accept the alret. I have already tried implementing wait & everything. problem is pop-up comes & immediately closes automatically
}

Please, guys need help..! First time posting a question..!! Thanks in advance..!!

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Message has been deleted

John Smart

unread,
Dec 7, 2016, 11:03:53 AM12/7/16
to Saunak Tarafdar, Serenity BDD Users Group
It may well be an issue with the Firefox driver. Have you checked for similar defects there?

On 7 December 2016 at 16:02, Saunak Tarafdar <tarafda...@gmail.com> wrote:
I have tried with Chrome and it works fine. Issue is only with Firefox.


On Tuesday, December 6, 2016 at 12:41:25 PM UTC+5:30, Jatin Kaushik wrote:

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-users+unsubscribe@googlegroups.com.
To post to this group, send email to thucydides-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Saunak Tarafdar

unread,
Dec 7, 2016, 11:05:34 AM12/7/16
to Serenity BDD Users Group, jatin...@gmail.com
I have tried with Chrome and it works fine. Issue is only with Firefox.
On Wednesday, December 7, 2016 at 12:11:18 PM UTC+5:30, John Smart wrote:
Does it happen if you use Chrome instead?
On 7 December 2016 at 06:26, Jatin Kaushik <jatin...@gmail.com> wrote:
Hi Guys,

Anyone...any suggestions..!!

FF version is 46 & Selenium jar is 2.53..!!

On Tuesday, December 6, 2016 at 12:41:25 PM UTC+5:30, Jatin Kaushik wrote:

**

[main] ERROR net.serenitybdd.core.Serenity - No alert is present (WARNING: The server did not provide any stacktrace information)

**

My Question is exactly similar to this one "Firefox alert box not detected with Selenium WebDriver"

But I am not able to find the solution.Even I have tried all kind of waits, changed firefox versions & tried the solution mentioned in the shared link. But, either I am not able to implement it or its not working.

So, guys need urgent help this is the only thing blocking me with my automation project.

Issue: When doing this task manually pop up comes up when I click on update button & its working fine.

But, when i do same action using automation pop-up shows & immediately closes automatically within a fraction of seconds & serenity throws error that No Alert not found. Also, alert window that appears during automation is bit different than the one found during manual execution. Please, refer to the link shared above if you want to see the difference in windows.

  public void i_click_update_button() throws InterruptedException {
    btn_update.waitUntilClickable().click(); // clicks the button & pop-up comes
  }      

  public void Accept_POP_UP() throws InterruptedException {

    getAlert().accept(); // code to accept the alret. I have already tried implementing wait & everything. problem is pop-up comes & immediately closes automatically
}

Please, guys need help..! First time posting a question..!! Thanks in advance..!!

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Alan Graf

unread,
Jan 25, 2017, 9:01:27 AM1/25/17
to Serenity BDD Users Group, jatin...@gmail.com
I can also confirm i have issue with firefox ESR 45.7.0 and Selenium IDE 2.9.1' s webdriver (whichever one that is)

Chrome works fine

adi....@outlook.com

unread,
Jan 31, 2017, 8:28:10 AM1/31/17
to Serenity BDD Users Group
I have found a similar issue, not related to serenity but rather to firefox. Disclaimer: I have used this to solve this issue in a framework that does not use Serenity!

When creating the driver add to the capabilities:
desiredCapability.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE);
This will ensure that Firefox does not dismiss the alert as it does by default.

Maybe this info might help you
Reply all
Reply to author
Forward
0 new messages