power_settings_new

Element Not Visible Exception

by
+1 vote
253 views
 
WebDriverWait wait = new WebDriverWait(driver,30);
 wait.until(ExpectedConditions.presenceOfElementLocated(By.id("number"))); 
    
 WebElement card_no = driver.findElement(By.id("number"));
    card_no.sendKeys("4000000000000101");
 
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.

 
by
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.
Uday
by (171 points)
Great. I am glad that it helped you out to identify root cause.
add
...