-1

The process I want to automate is -

When a button(Sign in on https://www.happyeasygo.com/) is clicked pop up window appears to login Then I have to enter my username:

Script

* Settings Library SeleniumLibrary Test Cases *

Login test for happyeasygo

Open Browser      https://www.happyeasygo.com/         gc
Click Element    xpath://body[@class='modal-open']/div[1]/div[1]/div[1]/div[1]/a[1]    
Maximize Browser Window
sleep  5
Click Element    xpath://a[contains(text(),'Sign in')]
Input Text       xpath://input[@id='user_phone']      959****701


and i am getting error for all below Elemet with locator not found 
Elemnt used :
//input[@id='user_phone']
/html[1]/body[1]/div[13]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]/div[1]/form[1]/dl[1]/dd[1]/div[2]/input[1]
#user_phone

Please help?

  • Is the first modal closing and the sign in form opening normally before the error happens? – João Farias May 15 at 13:38
1

Some more information would be useful (such as the actual error you are getting and the actual code being used.

However from what you've put I'd wager it's an issue with a timeout between clicking the Sign In screen and it trying to enter text in a box that hasn't rendered yet.

So you could add a wait clause until it appears

e.g.

Click Element    xpath://a[contains(text(),'Sign in')]

// Wait for the element to appear on the page
wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//input[@id='user_phone']")));

Input Text  959****701

You could also use a wait instead of the "sleep 5", waiting instead for the Login option to appear. This prevents your test having artificial pauses that may not be needed.

0

it could also be the case that the pop up fisplayed may not br web element. mostly the pop up from chrome is identified as window pop up. Use autoit to handle this popup

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.