1
votes

I am using selenium IDE to record the commands. I need to test the red rout for login screen. But Selenium is not recognizing the alert coming from the application. Highlighted in bold alert message is not captured by the selenium IDE.

selenium.open("http://192.168.132.244:8080/SampleApp/");
assertEquals("SampleApp", selenium.getTitle());
selenium.type("name=userame", "NoUser");          --USER NAME
selenium.type("name=password", "Password1"); --Password
selenium.click("css=input[type=\"image\"]"); --Login button
selenium.waitForPageToLoad("30000");   

Please enter correct Username and Password. -- Alert message

assertEquals("SampleApp", selenium.getTitle());

Please help me out completing this selenium...

3

3 Answers

0
votes

Try out this 1

assertEquals("Please enter correct Username and Password.", selenium.getAlert());

Let me know whether working or not.

0
votes

I've also had success with waitForAlert versus an assert or verify, but as with all your mileage may vary.

0
votes

USe this command hope this will help you <tr> <td>storeAlert</td> <td>a</td> <td></td> </tr> <tr> <td>echo</td> <td>${a}</td> <td></td> </tr>