0
votes

I am trying to automate login process for a website. In the login screen, we have username, password and login button. This login button will be enabled only when both username and password are entered.

While recording via selenium IDE,the button is getting enabled. But when i try playing the testcase, I am getting exception as '[error] Element xpath=(//ul[@id='main-nav']/li[3]/a/img)2 not found'

I tried researching about this issue and there were suggestions to use 'sendKeys', 'fireEvent'.. But nothing works for me.. Please help me to resolve this issue..

Link : Selenium Test Case Screenshot with code and exception

Solution: Selenium Test Case Screenshot with working code

Thanks, Suriya

2

2 Answers

0
votes

One of the solutions for this issue is that once you are done with entering the UserName and Password, just click on any other webElement on the Page before clicking the Login Button. It might work for you. There are few instances wherein the login button only enables when the user enters a username AND password.

Insert the code in between password and Login Command,

Command   Target                    Value
click     //(WebElement Xpath)      
0
votes

I see 2 possible reasons why you are getting that error..

  1. Basing from the screenshot you provided, your test case program execution is too fast so you need to set the test speed to slowest.

  2. The xpath:idRelative value consistently changes every after session so you need to try a different locator. Ex: css or xpath:locator