Skip to content

Instantly share code, notes, and snippets.

@executeautomation
Created August 11, 2021 21:18
Show Gist options
  • Save executeautomation/738667105b45f7b1fe86feaa3a7667ba to your computer and use it in GitHub Desktop.
Save executeautomation/738667105b45f7b1fe86feaa3a7667ba to your computer and use it in GitHub Desktop.
namespace XUnitDemo
{
/// <summary>
/// WebDriverFixture code for XUnit to handle
/// Selenium WebDriver
/// </summary>
public class WebDriverFixture : IDisposable
{
public ChromeDriver ChromeDriver { get; private set; }
public WebDriverFixture()
{
//WebDriverManager
var driver = new DriverManager().SetUpDriver(new ChromeConfig());
ChromeDriver = new ChromeDriver();
}
public void Dispose()
{
ChromeDriver.Quit();
ChromeDriver.Dispose();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment