Element Not Visible Exception

+1 vote
WebDriverWait wait = new WebDriverWait(driver,30);
 WebElement card_no = driver.findElement(By.id("number"));
The card_no is a textbox visible to me.
But when I run I get Element Not visible Exception.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

by (171 points)
0 votes

I can think of one possible scenario. It looks like you have layer on top of card_no. Check if card_no is under some other element. In that case, you will have to do send keys to that element and not to card_no.

Thanks Mayur For your answer.Solution is more similar to the one you have given.
There are two elements with the same id out of which 1 is not visible.This is poor design to have two elements with same id.

Thanks a lot.
by (171 points)
Great. I am glad that it helped you out to identify root cause.