一个弹出窗口(记住密码)即将登录到gmail时如何使用java将控件传递给selenium webdriver弹出窗口,下面是代码并抛出异常...任何建议
driver.get("https://www.gmail.com/");
driver.findElement(By.id("Email")).sendKeys("usrnm");
driver.findElement(By.id("next")).click();
driver.findElement(By.id("Passwd")).sendKeys("pwrd");
driver.findElement(By.id("signIn")).click();
driver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS );
try{
Alert alert=driver.switchTo().alert();
System.out.println("alert display");
alert.dismiss();
}
catch(Exception e)
{
System.out.println("alert didnt display)");
}