3

I am trying to click on save button on a popup on the same window, the popup also has a text box, to which I am able to successfully send the text, but when I attempt to click the button, error comes as element not visible

asked Jun 21, 2018 at 10:27
1
  • what version of selenium are u using ? Commented Jun 21, 2018 at 13:53

3 Answers 3

4

Element not visible exception can be resolved by using Explicit wait. Explicit wait in selenium will wait until the element is visible. Once it's visible you can perform the necessary operation.

Syntax for Explicit wait

WebDriverWait wait = new WebDriverWait(driver,30);
WebElement e = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("your locator value")));

In the above code selenium will wait for 30 seconds until the element is visible and once it is visible, selenium will perform the required action on it.

answered Jun 21, 2018 at 10:45
1

Give proper Wait command and try either of these below Xpath. This will work.

 //button[@id='search]
 //button[contains(text(),'Save')]
answered Jun 21, 2018 at 10:31
0
1

Apart from wait strategy, need to check if property wise visible is true on condition, otherwise different locator strategy if current one is not supporting as mentioned by others in this thread.

answered Jun 22, 2018 at 6:08

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.