| webdriver.FindElement(By.Id("search_button")).Click(); |
| Thread.Sleep(5000); |
| IWebElement searchResult = webdriver.FindElement(By.Id("search_result")); |
| IWebDriver webdriver = new ChromeDriver(); |
| webdriver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5)); |
|
|
| webdriver.FindElement(By.Id("search_button")).Click(); |
| IWebElement searchResult = webdriver.FindElement(By.Id("search_result")); |
| WebDriverWait webdriverWait = new WebDriverWait(webdriver, TimeSpan.FromSeconds(5)); |
| IWebElement searchResult = webdriverWait.Until(x=>x.FindElement(By.Id("search_result"))); |
| DefaultWait<IWebDriver> fluentWait = new DefaultWait<IWebDriver>(webdriver); |
| fluentWait.Timeout = TimeSpan.FromSeconds(5); |
| fluentWait.PollingInterval = TimeSpan.FromMilliseconds(250); |
| fluentWait.IgnoreExceptionTypes(typeof(NoSuchElementException)); |
| IWebElement searchResult = fluentWait.Until(x=>x.FindElement(By.Id("search_result"))); |
No comments:
Post a Comment