1

I'm trying to create some simple test cases with Selenium IDE.

I'm having a problem with recording test cases which include a Javascript alert since Selenium doesn't support those pop-ups. So I tried to use a workaround by clicking just the Enter button when I know that the pop-up is visible.

Let's say that the alert always appears when a user visits one of my html pages. The user must click OK and in order to continue browsing.

I tried to create a test case with the command "keyPress". But I have absolutely no idea which target to use because there's no element I'm using in this case, I just want to press Enter.

Can anybody help me?

Daniel
  • 502
  • 6
  • 17
  • [Click in OK button inside an Alert (Selenium IDE)](http://stackoverflow.com/questions/1348937/click-in-ok-button-inside-an-alert-selenium-ide) – jantimon Feb 18 '13 at 09:54
  • [Problem with Alert in the Selenium IDE](http://stackoverflow.com/questions/1348775/problem-with-alert-in-the-selenium-ide) – jantimon Feb 18 '13 at 09:55
  • [How can I press the alert ok button programmatically?](http://stackoverflow.com/questions/10749959/how-can-i-press-the-alert-ok-button-programmatically) – jantimon Feb 18 '13 at 09:57

1 Answers1

0

selenium cannot capture java script alert so what we can do is put store alert command in the place where the alert will appear what this command will do is it automatically click ok button of the alert

command:StoreAlert

Target:text

text is the variable in which the alert message is stored.

thank you.

Nikhil Surendran
  • 956
  • 4
  • 14
  • 25