ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Getting NoAlertPresentException if the alert is shown before page loaded. #1056

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
See http://goo.gl/ll2FvQ for common issues.

Issue Description:
We have a salesforce application where we are clicking on a button which opens 
a new window but before loading the content on that window, developer has shown 
an alert. Once the user accepts this alert then the page gets loaded on the new 
window.

We are switching to this window using 

driver.switchTo().window("CDwindow-FC77DF69-9374-415C-BD22-15011B339DC3");

After switching when we are firing this statement driver.switchTo().alert(); 
the it is throwing NoAlertPresentException. But visually I could see an alert 
is there on this new window. I tried waiting for 60 seconds but still no luck.

This is easily reproducible on ChromeDriver 2.11 and Java binding 2.42.2.

Steps to reproduce (if relevant, you MUST provide a simplified html page or
link to public site):

We are switching to this window using 

driver.switchTo().window("CDwindow-FC77DF69-9374-415C-BD22-15011B339DC3");

After switching when we are firing this statement driver.switchTo().alert(); 
the it is throwing NoAlertPresentException. But visually I could see an alert 
is there on this new window. I tried waiting for 60 seconds but still no luck.

This is easily reproducible on ChromeDriver 2.11 and Java binding 2.42.2.

-----Other helpful tips:
Attach your chromedriver log with verbose logging enabled (see
http://goo.gl/5Sx8mC for how to do this).

Original issue reported on code.google.com by sahaja...@gmail.com on 9 Mar 2015 at 11:16

GoogleCodeExporter commented 9 years ago
Here are the logs from ChromeDriver:

[678.315][INFO]: Waiting for pending navigations...
[678.315][INFO]: Done waiting for pending navigations
[678.315][INFO]: RESPONSE GetAlertMessage no alert open
  (Session info: chrome=41.0.2272.76)
[678.389][INFO]: COMMAND GetAlertMessage {

}
[678.389][INFO]: Waiting for pending navigations...
[678.389][INFO]: Done waiting for pending navigations
[678.389][INFO]: RESPONSE GetAlertMessage no alert open
  (Session info: chrome=41.0.2272.76)

Original comment by sahaja...@gmail.com on 9 Mar 2015 at 12:13

GoogleCodeExporter commented 9 years ago

Original comment by gmanikp...@chromium.org on 9 Mar 2015 at 4:57