Skip to content

[🐛 Bug]: Quit () takes a long time when driver instance is created with ChromeDriverService #14633

@CarlVerret

Description

@CarlVerret

What happened?

We've been experiencing something quite strange with Quit function of webdriver instanciated with ChromeDirverService since an upgrade to latest version:

let's say we create an instance like this :

    Instance = new ChromeDriver( chromeOptions);
    Instance.Quit()  //  is really quick

But, if we instanciate the driver with this constructor :

    Instance2 = new ChromeDriver(ChromeDriverService.CreateDefaultService(Environment.CurrentDirectory), chromeOptions);
    Instance2.Quit() ; // Quitting takes a lot of time (over 10 seconds)

How can we reproduce the issue?

Instanciate a webdriver like this
 var chromeOptions = new ChromeOptions();

 if (headLess)
   chromeOptions.AddArgument("headless");

  Instance2 = new ChromeDriver(ChromeDriverService.CreateDefaultService(Environment.CurrentDirectory), chromeOptions);

Relevant log output

I've turned on logging as following :

   Log.SetLevel(LogEventLevel.Trace);
   Log.Handlers.Add(new FileLogHandler("C:\\temp\\log_selenium_itself.txt"));
   Log.SetLevel(typeof(ChromeDriverService), LogEventLevel.Trace);
   Log.SetLevel(typeof(SeleniumManager), LogEventLevel.Trace);
   Log.SetLevel(typeof(ChromeDriver), LogEventLevel.Trace);


The only relevant-like info I saw when comparing both constructors : 

With ChromeDriverService it starts with the two following lines :


Instance2 = new ChromeDriver(ChromeDriverService.CreateDefaultService(Environment.CurrentDirectory), chromeOptions);

-----

2024-10-21 13:20:53.549 DEBUG HttpCommandExecutor: Executing command: []: newSession {"capabilities":{"firstMatch":[{"browserName":"chrome","goog:chromeOptions":{"args":["headless","ignore-certificate-errors","start-maximized"]}}]}}
2024-10-21 13:20:53.583 TRACE HttpCommandExecutor: >> Method: POST, RequestUri: 'http://localhost:52810/session', Version: 1.1, Content: System.Net.Http.ByteArrayContent, Headers:

 Instance = new ChromeDriver( chromeOptions); starts with 4 lines instead
-----------------------------------------------

2024-10-21 13:21:59.163 TRACE SeleniumManager: Driver path: C:\Users\cav001\.cache\selenium\chromedriver\win64\130.0.6723.58\chromedriver.exe
2024-10-21 13:21:59.165 TRACE SeleniumManager: Browser path: C:\Program Files\Google\Chrome\Application\chrome.exe
2024-10-21 13:21:59.338 DEBUG HttpCommandExecutor: Executing command: []: newSession {"capabilities":{"firstMatch":[{"browserName":"chrome","goog:chromeOptions":{"args":["headless","ignore-certificate-errors","start-maximized"],"binary":"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"}}]}}
2024-10-21 13:21:59.360 TRACE HttpCommandExecutor: >> Method: POST, RequestUri: 'http://localhost:52851/session', Version: 1.1, Content: System.Net.Http.ByteArrayContent, Headers:

Operating System

Windows 10 - aspnet core

Selenium version

4.25.0

What are the browser(s) and version(s) where you see this issue?

Chrome

What are the browser driver(s) and version(s) where you see this issue?

Selenium.WebDriver.ChromeDriver 130.0.6723.5800

Are you using Selenium Grid?

none

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!C-dotnet.NET BindingsI-defectSomething is not working as intendedJ-staleApplied to issues that become stale, and eventually closed.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions