Selenium c# Webdriver: Wait Until Element is Present

Selenium c# Webdriver: Wait Until Element is Present

To wait for an element to be visible in C# use WebDriverWait and an expected condition as shown below.

var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
wait.Until(drv => drv.FindElement(By.Id("searchInput")));

Leave a reply

Your email address will not be published. Required fields are marked*

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.