WebDriver - wait for element using C#

WebDriver - wait for element using C#

In order to explicitly wait until an element is visible, the most direct and simple way is to use a WebDriverWait object. The following script shows this.

WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
wait.Until(driver=>driver.FindElement(By.XPath("//a[strong[.='English']]")));

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.