The SafariDriver does not support alert handling. To prevent tests from handing when an alert is opened, they are always immediately dismissed. For more information, see http://code.google.com/p/selenium/issues/detail?id=3862 (WARNING: The server did not provide any stacktrace information)Command duration or timeout: 19 millisecondsBuild info: version: '2.43.1', revision: '5163bceef1bc36d43f3dc0b83c88998168a363a0', time: '2014-09-10 09:43:55'System info: host: 'PBTALYY-1', ip: '10.130.0.162', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_67'Session ID: nullDriver info: org.openqa.selenium.safari.SafariDriverCapabilities [{platform=WINDOWS, cssSelectorsEnabled=true, javascriptEnabled=true, secureSsl=true, browserName=safari, takesScreenshot=true, version=5.1.7}]
A modal dialog was opened. The SafariDriver does not support interacting with modal dialogs. To avoid hanging your test, the alert has been dismissed. For more information, see http://code.google.com/p/selenium/issues/detail?id=3862: Please enter your usernameBuild info: version: '2.43.1', revision: '5163bceef1bc36d43f3dc0b83c88998168a363a0', time: '2014-09-10 09:43:55'System info: host: 'PBTALYY-1', ip: '10.130.0.162', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_67'Session ID: nullDriver info: org.openqa.selenium.safari.SafariDriverCapabilities [{platform=WINDOWS, cssSelectorsEnabled=true, javascriptEnabled=true, secureSsl=true, browserName=safari, takesScreenshot=true, version=5.1.7}]
public void login(String username, String password) {username_input.clear();username_input.sendKeys(username);password_input.clear();password_input.sendKeys(password);try {Alert alert = sb.driver.switchTo().alert(); //THROWS NoAlertPresentException
String alertMessage = alert.getText();System.out.println("Alert Message " + alertMessage);alert.accept();
} catch (Exception ex) {String msg = ex.getMessage();System.out.println(msg);}try {submit.click(); //THROWS UnhandledAlertException} catch (Exception ex) {String msg = ex.getMessage();System.out.println(msg);}}
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/fa1543ee-6e11-4167-8a26-3fae31219722%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/BLU174-W19DC22C81B336CFC43410F909F0%40phx.gbl.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZL%3DhAk7%3DPvB16wNfB7FDCG%3DTgPoYDAYoJzo7FJjfP5AW4w%40mail.gmail.com.