I am trying to sign in into following website. But Selenium is not able to type text in username field. http://www.livejournal.com/login.bml

It is throwing following error

Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: element not visible

Xpath for username field = //input[@id='user']

up vote 2 down vote accepted

There are two input fields with same id ("user") located on page. First is hidden, so you need to handle second one. Try this XPath:

(//input[@id="user"])[2]
  • It worked. Thank you so much. – Aashish Ola Jan 30 '17 at 10:30

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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