Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(3));
- IWebElement element = wait.Until(ExpectedConditions.ElementExists(By.Id("foo")));
- [FindsBy(How = How.Id, Using = "errorMessage")]
- public IWebElement btnSubmit { get; set; }
- CheckElementExists(errorMessage))
- public bool CheckElementExists(IWebElement pageObject)
- {
- Browser.getDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromMilliseconds(100);
- try
- {
- return pageObject.Equals(pageObject);
- }
- catch (NoSuchElementException)
- {
- return false;
- }
- finally
- {
- Browser.getDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(30);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement