-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛 Bug]: C#: Driver process left running if DriverService is reused and Driver disposed #14624
Comments
@kevinoid, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
If it is incorrect to reuse an instance of |
How I am reading it: var driverService = ChromeDriverService.CreateDefaultService(); // just new driverService object
var driver1 = new ChromeDriver(driverService);
driver1.Dispose(); // you dispose driver1 but not driverService
var driver2 = new ChromeDriver(driverService);
driver2.Dispose(); // you dispose driver2 but not driverService So, |
Are you saying it is a bug that selenium/dotnet/src/webdriver/WebDriver.cs Line 731 in d922168
DriverService.Dispose() :
|
How it works currently: var driverService = ChromeDriverService.CreateDefaultService();
var driver1 = new ChromeDriver(driverService); // starts new chromedriver.exe
driver1.Dispose(); // ends the chromedriver.exe
var driver2 = new ChromeDriver(driverService); // starts new chromedriver.exe
driver2.Dispose(); // DOES NOT end the chromedriver.exe This is definitely a bug, user experience should be improved here. I don't know whether ChromeDriverService is supposed to be reusable: understanding it let's us understand what is expected user experience should be. @diemol @titusfortner do you know whether |
@kevinoid did it work properly with previous Selenium version, and which one? |
@nvborisenko Testing just now, I'm able to reproduce the issue with Selenium.WebDriver versions back to 3.11.1, but I'm unable to reproduce the issue with 3.11.0 or earlier. |
Thank you good man, it will help so much! |
Current understanding is: ChromeDriverService should be reusable. |
What happened?
Using the same instance of
ChromeDriverService
to construct a secondChromeDriver
instance after a first has been disposed causes achromedriver.exe
process to remain running after the program exits. The same issue occurs forEdgeDriverService
/EdgeDriver
(and presumably others, although I haven't tested).How can we reproduce the issue?
Relevant log output
Operating System
Windows 10
Selenium version
C# with Selenium.WebDriver 4.25.0
What are the browser(s) and version(s) where you see this issue?
Chrome 130.0.6723.59
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 130.0.6723.58
Are you using Selenium Grid?
No
The text was updated successfully, but these errors were encountered: