Skip to content

Instantly share code, notes, and snippets.

@nadvolod
Created May 2, 2016 23:20
Show Gist options
  • Save nadvolod/9249cd30ac71065da2d20242f3683ac0 to your computer and use it in GitHub Desktop.
Save nadvolod/9249cd30ac71065da2d20242f3683ac0 to your computer and use it in GitHub Desktop.
How to create a fluent wait for IWebDriver
var _driver = new FirefoxDriver();
var wait = new DefaultWait<IWebDriver>(_driver)
{
Timeout = TimeSpan.FromSeconds(10),
Message = "Dude, where's my element?",
PollingInterval = TimeSpan.FromSeconds(1)
};
wait.IgnoreExceptionTypes(typeof(NoSuchElementException));
var myElement = wait.Until(ElementIsVisible(elementId));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment