Skip to content

Instantly share code, notes, and snippets.

@johnmmoss
Created October 20, 2018 21:00
Show Gist options
  • Select an option

  • Save johnmmoss/a929d831402e0cce242229b496c4f45e to your computer and use it in GitHub Desktop.

Select an option

Save johnmmoss/a929d831402e0cce242229b496c4f45e to your computer and use it in GitHub Desktop.
private static string websiteUrl = ConfigurationSettings.AppSettings["WebSiteUrl"];
[BeforeFeature]
public static void BeforeFeature()
{
IWebDriver driver = new ChromeDriver();
FeatureContext.Current.Set(driver);
driver.Navigate().GoToUrl(websiteUrl);
}
[AfterFeature]
public static void AfterFeature()
{
// Clear up the webdriver
var webDriver = FeatureContext.Current.Get<IWebDriver>();
webDriver.Quit();
webDriver.Dispose();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment