We have below wait conditions in Selenium C# API.
Below code waits for element with ID login until it exists. Please note that timeOut variable contains total number of seconds you need to wait.
What do you think on above selenium topic. Please provide your inputs and comments. You can write to me at reply2sagar@gmail.com
- Wait until Element exists in page
- Wait until Element becomes visible on page
- Wait until page title becomes as expected
Below code waits for element with ID login until it exists. Please note that timeOut variable contains total number of seconds you need to wait.
new WebDriverWait(driver, TimeSpan.FromSeconds(timeOut)).Until(ExpectedConditions.ElementExists((By.Id(login))));
Below code waits for element with ID login until it gets visible on the page new WebDriverWait(driver, TimeSpan.FromSeconds(timeOut)).Until(ExpectedConditions.ElementIsVisible((By.Id(login))));
Below code waits until Page title becomes Yahoo News new WebDriverWait(driver, TimeSpan.FromSeconds(timeOut)).Until(ExpectedConditions.TitleIs("Yahoo News"));
Below code waits until Page title contains News word new WebDriverWait(driver, TimeSpan.FromSeconds(timeOut)).Until(ExpectedConditions.TitleContains("News"));
In Selenium-Java API, we have more such conditions like wait until the element is refreshed, wait until the element is hidden or wait until text value of the element becomes as expected.What do you think on above selenium topic. Please provide your inputs and comments. You can write to me at reply2sagar@gmail.com
No comments:
Post a Comment