1

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/";
    }
DevDave
  • 6,700
  • 12
  • 65
  • 99

1 Answers1

1

An answer posted here solved my problem.

An earlier version of the driver (20.0.1133.0) quits and closes down without any problem, this fixed the problem for me.

Community
  • 1
  • 1
DevDave
  • 6,700
  • 12
  • 65
  • 99