ericmckean / chromedriver

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

ChromeDriver hangs when attempting to dismiss an alert. #764

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Google Chrome   34.0.1847.116 (Official Build 260972) 
OS  Mac OS X 
ChromeDriver (v2.9.248307)

driver.switchTo().alert().dismiss() just hangs when the underlying dialog is an 
actual alert. For alerts,
chromedriver should handle dismiss() and accept() the same (since that is the 
only option).

Everything works as expected for prompt and confirm dialogs.

Repo case below.
=======================================================

WebDriver driver = new ChromeDriver();
WebElement button;

driver.get("data:text/html;charset=utf-8,<!DOCTYPE html><button 
onclick=\"prompt('hi');\">Click me</button>");
button = driver.findElement(By.tagName("button"));
button.click();
driver.switchTo().alert().accept();
button.click();
driver.switchTo().alert().dismiss();

driver.get("data:text/html;charset=utf-8,<!DOCTYPE html><button 
onclick=\"confirm('hi');\">Click me</button>");
button = driver.findElement(By.tagName("button"));
button.click();
driver.switchTo().alert().accept();
button.click();
driver.switchTo().alert().dismiss();

driver.get("data:text/html;charset=utf-8,<!DOCTYPE html><button 
onclick=\"alert('hi');\">Click me</button>");
button = driver.findElement(By.tagName("button"));
button.click();
driver.switchTo().alert().accept();
button.click();
driver.switchTo().alert().dismiss();  // HANGS HERE

driver.quit();

Original issue reported on code.google.com by jle...@google.com on 19 Apr 2014 at 3:41

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:18

GoogleCodeExporter commented 9 years ago
This issue is reproducible on Mac OS X 10.9.5
issue exist with ChromeDriver however FirefoxDriver works good in this case.

tested with latest version of 
ChromeDriver:- 2.14
Chrome browser:- 41.0.2272.76
Selenium:- 2.45

Original comment by agau...@chromium.org on 26 Mar 2015 at 9:45

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 31 Mar 2015 at 11:48