Skip to content

Instantly share code, notes, and snippets.

@rcasady616
Created August 15, 2014 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcasady616/b2488e72d062c95dc97b to your computer and use it in GitHub Desktop.
Save rcasady616/b2488e72d062c95dc97b to your computer and use it in GitHub Desktop.
Ensure that WebDriver is disposed after each test even if the test fails
public IWebDriver Driver;
[SetUp]
public void SetupTest()
{
Driver = WebDriverFactory.GetSauceDriver();
}
[TearDown]
public void TearDown()
{
if (Driver != null)
Driver.Quit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment