-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Description
Description
In version 4.35.0 and below the browser process stopped when you killed the main program process.
For example when running the program in an IDE doing development, and you stopped the program to make a change.
Now, the browser process keeps running, and you have to close the browser process manually. Either by closing the browser window, or killing the process in the job list if it's running in headless
I noticed the change after updating from 4.24.0 to 4.40.0 some days ago.
The change seem to happen in 4.36.0. on version 4.35.0 the browser process closes as expected, but on version 4.36.0 the process keeps running.
I can't see anything in the change log that could indicate this change, and therefore i suspect it is a bug/unintended behavior.
I have reproduced this on windows 11 with both the normal google chrome (at home) and googlechrome enterprise from https://chromeenterprise.google/download/thank-you/?platform=WIN64_MSI&channel=stable&usagestats=0 (at work), and in Rider and Visual Studio 2022.
All tests where done on .net SDK Version: 10.0.103.
For all combinations it works on version 4.35.0 but not on version 4.36.0, 4.37.0, 4.38.0, 4.39.0 or 4.40.0
I have not tried other browsers.
Steps to reproduce:
Open a new .net 10 project.
Add Selenium.WebDriver 4.36.0 nuget package
Replace the program.cs content with this code:
using OpenQA.Selenium.Chrome;
// if you run with this with Selenium.WebDriver version 4.35.0 the browser stops if you stop the program
// if you run with this with Selenium.WebDriver version 4.36.0 the browser stays open after you stop the program
using var chromeDriver = new ChromeDriver();
// stop the process before this sleep ends to trigger the bug
Thread.Sleep(1000000);
Run the program and stop et before the Sleep ends (if the chromeDriver variable goes out of scope it closes as expected)
See the browser process still running
To see the old behavior, change Selenium.WebDriver to 4.35.0 and then run the code again
Now the browser should close when you stop the program from running (it might take a few seconds but it should close automatically)
This is my first bug report, if i missed anything or if you need more information please let me know and i will see what i can do.
Reproducible Code
using OpenQA.Selenium.Chrome;
// if you run with this with Selenium.WebDriver version 4.35.0 the browser stops if you stop the program
// if you run with this with Selenium.WebDriver version 4.36.0 the browser stays open after you stop the program
using var chromeDriver = new ChromeDriver();
// stop the process before this sleep ends to trigger the bug
Thread.Sleep(1000000);ℹ️ Last known working version: 4.35.0