New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 655071 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

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
 
Components: -Blink Test
Not blink. Unsure where to put, so applying Test component.
Labels: TE-NeedsTriageHelp
Components: Tests>WebDriver
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?
Cc: gmanikpure@chromium.org
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!
Status: WontFix (was: Unconfirmed)
Good to know!

Sign in to add a comment