RE: Wait for Element

Hi Friends,

I need to put a wait for below scenario , please help me how I can put using selenium webdriver. Please also tell this kind of wait comes under synchronous wait or Asynchronous wait.

1. Click button 1
2. User redirected to a screen after clicking above button
3. <Here I have to put a wait > Until a label element at certain xpath appears with a text.

amitjain Supporter Asked on March 13, 2015 in Selenium WebDriver.
Add Comment
1 Answers

This will fall under synchronized wait. Waits don’t make much sense in Asynchronous modes. You have to use fluent wait like this, You might want to change the expected condition.

WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(>someid>)));


Professor Answered on March 13, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.