Currently when running tests, Chrome driver's stack up and are never fully closed.
Have tried using:
driver.Close();
driver.Quit();
driver.Dispose();
Relating to this discussion
But the Chrome drivers still seem to exist after tests have run / finished.
After scenario hook:
[AfterScenario]
public void AfterScenario()
{
var driver = _objectContainer.Resolve<IWebDriver>();
driver?.Quit();
driver?.Dispose();
}
After feature hook:
[AfterFeature]
public static void AfterFeature(FeatureContext featureContext)
{
var driverService = featureContext.Get<ChromeDriverService>();
driverService.Dispose();
}
Running 4 tests in parallel currently so want to avoid closing all browsers by accident.
Have confirmed the AfterScenario
is being called when a scenario finishes but they still seem to be lurking and slowing down my machine locally when they stack up. As mentioned I have tried driver.Close()
but this hasn't helped.
- Chromeversion: 85.0.4183.8700
- Specflow - 3.0.225
- Selenium webdriver - 3.141