1

I want to press the Enter/Cancel button on a security certificate which is shown while the application is loaded. It is a single-Sign-On (SSO Enabled).

Have a look at this Similar Post.

The below code works fine in IE and Firefox, but not in google chrome.

Alert alert = driver.switchTo().alert();
Robot a = new Robot();
a.keyPress(KeyEvent.VK_ENTER);
a.keyPress(KeyEvent.VK_CANCEL);

I am using java with selenium webdriver.

Chrome version : 37.0.2062.120

Community
  • 1
  • 1
Siva
  • 39
  • 1
  • 3
  • 7

1 Answers1

0

This is my c# implementation that works for me, give it a try and see if it works for you.

IAlert alertDialog = driver.SwitchTo().Alert();
alertDialog.Accept();

EDIT: adding java implementation

Alert alertDialog = driver.switchTo().alert();
alertDialog.accept();
  • Hi, It is not working. Actually it is not an alert. It is SSO enabled popup. Kindly see the detailed description in below link. 'http://stackoverflow.com/questions/27986032/selenium-2-webdriver-unhandledalertexception-java' – Siva May 09 '15 at 11:06