Using MSTest in Visual Studio, I am having a problem with Selenium WebDriver and, in particular, ChromeDriver. Whenever I call quit on the ChromeDriver, I get the message "chromedriver.exe" has stopped working" and the program freezes up.
I attempt to close each of my drivers at the end of all tests, in the class cleanup:
[ClassCleanup]
public static void ClassCleanup() {
drivers.ForEach(x => x.Quit());
}
The Firefox driver closes down fine but the Chrome driver always justs stops working. Can anyone help me with this?
Edit: A bit more of my code, for clarity (the path points to the chromedriver.exe program that I have added into my solution):
static IWebDriver driver;
static IWebDriver chromeDriver;
static string baseURL;
static List<IWebDriver> drivers;
[ClassInitialize]
public static void ClassInitialize(TestContext context) {
drivers = new List<IWebDriver>();
driver = new FirefoxDriver();
chromeDriver = new ChromeDriver(path);
drivers.Add(driver);
drivers.Add(chromeDriver);
baseURL = "http://localhost:4444/";
}