FuckTheWorld / chromedriver

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

alert.sendKeys("value") ==> value is not typed into the prompt dialog #1120

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Issue Description:
The driver is unable to send keys to a simple js prompt popup. ie:
<script>prompt("test")</script>

Steps to reproduce (if relevant, you MUST provide a simplified html page or
link to public site):
var alert = Driver.SwitchTo().Alert();
alert.SendKeys(value);
alert.Accept();

where driver is a chrome driver. This code works properly with Firefox.

Tested With:
Chrome version: Version 43.0.2357.81 m
Chrome Driver version: 2.15

Original issue reported on code.google.com by tasos....@gmail.com on 8 Jun 2015 at 1:32

GoogleCodeExporter commented 9 years ago
tasos.tei@

Thanks for filing the bug, we have tried in latest version of 
ChromeDriver(2.15), Chrome(v43.0.2357.81) and selenium(2.45) java bindings and 
unable to reproduce this issue in Ubuntu 14.04 and Mac OS X.

can you please let us know environment configuration where you are running your 
test.

---- HTML----
<html>
<body onload=onloadpop()>
<script type="text/javascript"> 
    function onloadpop(){
var y=window.prompt("please enter your name")
window.alert(y)
    }
</script>
</body>
</html>

------- java-------
 WebDriver driver = new ChromeDriver();
    driver.get(htmlfile);
    Thread.sleep(1000);
    Alert alert = driver.switchTo().alert();
    System.out.println(alert.getText());
    alert.sendKeys("testing");
    alert.accept();
    Thread.sleep(2000);
    System.out.println(alert.getText());
    driver.close();
    driver.quit();

Original comment by agau...@chromium.org on 8 Jun 2015 at 5:44

GoogleCodeExporter commented 9 years ago
Issue is reproducible on chrome browser version - 43.0.2357.81 and chrome 
driver 2.15 on Ubuntu 14.04 , Windows 8.1 , and Mac OS X 10.8.5

<html>
<body>
<script>prompt("test")</script>
</body>
</html>

Code:
 driver.get("file:///path/to/htmlfile");
Thread.sleep(2000);
Alert alert = driver.switchTo().alert();
 alert.sendKeys("testing"); ==> Issue is here, "testing" value is not typed into the prompt dialog

whereas, It works fine in Firefox

Original comment by gmanikp...@chromium.org on 8 Jun 2015 at 6:31

GoogleCodeExporter commented 9 years ago

Original comment by agau...@chromium.org on 9 Jun 2015 at 6:39

GoogleCodeExporter commented 9 years ago

Original comment by gmanikp...@chromium.org on 1 Jul 2015 at 5:54