selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🐛 Bug]: OpenQA.Selenium.WebDriverException: 'Cannot start the driver service on http://localhost:50909/'

Open linuxaged opened this issue 1 year ago • 9 comments

What happened?

Just follow the Use WebDriver to automate Microsoft Edge, but the driver service can not start, have tried ChromeDirver, EdgeDriver, FirefoxDriver, all failed with same error.

msedgedriver --version 131.0.2903.112 (16ab910a6e75f1c7d2da060bbe9ac569dfe64f70)
geckodriver --version 0.35.0 (9f0a0036bea4 2024-08-03 07:11 +0000)
chromedriver --version ChromeDriver 131.0.6778.205 (81b36b9535e3e3b610a52df3da48cd81362ec860-refs/branch-heads/6778_155@{#8})

dirver path has been added to user's PATH

> echo %PATH%
D:\app\geckodriver;D:\app\chromedriver-win64;D:\app\edgedriver_win64;

How can we reproduce the issue?

dotnet new console --framework net9.0
dotnet add package Selenium.WebDriver
dotnet add package Selenium.WebDriver.GeckoDriver

//Program.cs
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium;
class Program
{
    static void Main(string[] args)
    {
        var driver = new FirefoxDriver();
        try
        {
            driver.Url = "https://bing.com";

            var element = driver.FindElement(By.Id("sb_form_q"));
            element.SendKeys("WebDriver");
            element.Submit();

            Thread.Sleep(5000);
        }
        finally
        {
            driver.Quit();
        }
    }
}


### Relevant log output

```shell
'SeleniumCSharpProject.exe' (CoreCLR: DefaultDomain): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Private.CoreLib.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'D:\workspace\SeleniumCSharpProject\bin\Debug\net9.0-windows10.0.26100.0\SeleniumCSharpProject.dll'. Symbols loaded.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Runtime.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'd:\program files\microsoft visual studio\2022\enterprise\common7\ide\commonextensions\microsoft\hotreload\Microsoft.Extensions.DotNetDeltaApplier.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.IO.Pipes.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Linq.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Collections.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Console.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Threading.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Runtime.InteropServices.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Threading.Overlapped.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Security.AccessControl.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Security.Principal.Windows.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Security.Claims.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Runtime.Loader.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Collections.Concurrent.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'D:\workspace\SeleniumCSharpProject\bin\Debug\net9.0-windows10.0.26100.0\WebDriver.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Drawing.Primitives.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Threading.Thread.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Net.Sockets.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Net.Primitives.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\Microsoft.Win32.Primitives.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Diagnostics.Tracing.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Runtime.Intrinsics.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Memory.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Diagnostics.Process.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.ComponentModel.Primitives.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Text.Json.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Threading.ThreadPool.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Text.Encodings.Web.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Text.Encoding.Extensions.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Numerics.Vectors.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Private.Uri.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Net.Http.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Diagnostics.DiagnosticSource.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Net.Security.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Security.Cryptography.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'D:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\PrivateAssemblies\Runtime\Microsoft.VisualStudio.Debugger.Runtime.NetCoreApp.dll'. 
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\netstandard.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'D:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\Microsoft.IntelliTrace.TelemetryObserver.Common.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'D:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\Microsoft.IntelliTrace.TelemetryObserver.CoreClr.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Reflection.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Reflection.Extensions.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Runtime.Extensions.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Net.NameResolution.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Net.Quic.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Net.NetworkInformation.dll'. Symbol loading disabled by Include/Exclude setting.
'SeleniumCSharpProject.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0\System.Collections.NonGeneric.dll'. Symbol loading disabled by Include/Exclude setting.
Exception thrown: 'OpenQA.Selenium.WebDriverException' in WebDriver.dll
Exception thrown: 'OpenQA.Selenium.WebDriverException' in System.Private.CoreLib.dll
Exception thrown: 'OpenQA.Selenium.WebDriverException' in System.Private.CoreLib.dll
Exception thrown: 'OpenQA.Selenium.WebDriverException' in WebDriver.dll
An unhandled exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll
Cannot start the driver service on http://localhost:50909/

Operating System

Win11

Selenium version

C# 4.27.0

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

133.0.3 (32 bit)

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

GeckoDriver 0.35

Are you using Selenium Grid?

Not used

linuxaged avatar Dec 27 '24 01:12 linuxaged

@linuxaged, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] avatar Dec 27 '24 01:12 github-actions[bot]

Selenium.WebDriver.GeckoDriver package is not supported by Selenium. This way is better: https://www.selenium.dev/documentation/selenium_manager/

In any case please provide logs: https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/

nvborisenko avatar Dec 27 '24 12:12 nvborisenko

We need more information about this issue in order to troubleshoot.

Please turn on logging and re-run your code. Information on how to adjust logs for your language can be found in our Troubleshooting documentation.

github-actions[bot] avatar Dec 30 '24 09:12 github-actions[bot]

run the manager manually:

D:\workspace\SeleniumCSharpProject\bin\Debug\net9.0\selenium-manager\windows>selenium-manager.exe --proxy="127.0.0.1:12334"  --browser "firefox" --language-binding csharp --output json
{
  "logs": [
    {
      "level": "INFO",
      "timestamp": 1736156649,
      "message": "Driver path: C:\\Users\\bonsmile\\.cache\\selenium\\geckodriver\\win64\\0.35.0\\geckodriver.exe"
    },
    {
      "level": "INFO",
      "timestamp": 1736156649,
      "message": "Browser path: C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"
    }
  ],
  "result": {
    "code": 0,
    "message": "",
    "driver_path": "C:\\Users\\bonsmile\\.cache\\selenium\\geckodriver\\win64\\0.35.0\\geckodriver.exe",
    "browser_path": "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"
  }
}

but still the same error: 图片

linuxaged avatar Jan 06 '25 09:01 linuxaged

@linuxaged what if you start C:\\Users\\bonsmile\\.cache\\selenium\\geckodriver\\win64\\0.35.0\\geckodriver.exe manually?

nvborisenko avatar Jan 21 '25 10:01 nvborisenko

@linuxaged what if you start C:\\Users\\bonsmile\\.cache\\selenium\\geckodriver\\win64\\0.35.0\\geckodriver.exe manually?

1737593500496 geckodriver INFO Listening on 127.0.0.1:4444

linuxaged avatar Jan 23 '25 00:01 linuxaged

I am facing this issue "Cannot start the driver service on http://localhost:5090" when there is some proxy configured on system. I resolved it by adding localhost in NO_PROXY environment variable.

I faced it using selenium dotnet for chrome and edge.

Though this solution works, we need to do it manually. It will be better if its by default handled by selenium.

Maheshkale447 avatar Mar 17 '25 17:03 Maheshkale447

This issue was closed because we did not receive any additional information after 14 days.

github-actions[bot] avatar Mar 31 '25 20:03 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Apr 30 '25 22:04 github-actions[bot]