Autotests in selenium does not see JS alert by driver.switchTo().alert()
Reported by
osobol...@exadel.com,
Oct 12 2016
|
|||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36
Steps to reproduce the problem:
Selenium autotests failed on the step of verifying the presence of JS alert (confirmation pop-up)
In Firefox this method works
Method:
public static boolean isAlertPresent() {
try {
driver.switchTo().alert();
return true;
} catch (NoAlertPresentException e) {
return false;
}
What is the expected behavior?
isAlertPresent must be true
What went wrong?
Tests failed:
isAlertPresent is false
Did this work before? Yes 52
Chrome version: 53.0.2785.143 Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
Selenium version 2.53.1
Chromedriver version 2.24
,
Oct 14 2016
,
Nov 17 2016
,
Nov 17 2016
osoboleva@, I am not able to reproduce the issue on latest versions of Chrome v54.0.2840.100 and Chromedriver v2.25
Here is the code that I tried:-
WebDriver driver = new ChromeDriver();
driver.get("file:///path/to/page.html");
driver.findElement(By.id("btn")).click();
driver.switchTo().alert();
driver.switchTo().alert().accept();
<html>
<body>
<input type="button" id="btn" value="button" onclick="alert('hi')">
</body>
</html>
Please try executing your test on the latest versions . If you still see the issue, can you please share test code along with the test page?
,
Nov 17 2016
,
Nov 28 2016
We fixed the issue already The problem was with performance I had to add Thread.sleep(2000) before this step and tests stopped falling Issue can be closed thank you!
,
Nov 28 2016
Good to know! |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dglazkov@chromium.org
, Oct 13 2016