selenium: [🐛 Bug]: Error occurs if path contains multibyte characters

What happened?

I noticed one day that my Jenkins job was failing. I am writing tests for a web application with selenium using C#. new ChromeDriver() fails if the path of the project file being tested contains multi-byte characters. As far as I remember, no errors occurred in ver4.10.0. The test passes by removing multibyte characters from the path.

How can we reproduce the issue?

Write and execute test code in a file whose path contains multibyte characters.

ChromeOptions options = new ChromeOptions();
var driver = new ChromeDriver(service, options);

Relevant log output

OpenQA.Selenium.WebDriverException : Error starting process: C:\ProgramData\Jenkins\.jenkins\workspace\テスト\システムテスト\MyProject\bin\Debug\net8.0\selenium-manager\windows\selenium-manager.exe  --browser "chrome" --language-binding csharp --output json
---- OpenQA.Selenium.WebDriverException : Selenium Manager process exited abnormally with 69 code: C:\ProgramData\Jenkins\.jenkins\workspace\テスト\システムテスト\MyProject\bin\Debug\net8.0\selenium-manager\windows\selenium-manager.exe  --browser "chrome" --language-binding csharp --output json
Standard Output >>
{
  "logs": [
    {
      "level": "ERROR",
      "timestamp": 1716365603,
      "message": "Driver unavailable: Driver path: "
    }
  ],
  "result": {
    "code": 69,
    "message": "Driver unavailable: Driver path: ",
    "driver_path": "",
    "browser_path": ""
  }
}

<<

  Stack trace:
     at OpenQA.Selenium.SeleniumManager.RunCommand(String fileName, String arguments)
   at OpenQA.Selenium.SeleniumManager.BinaryPaths(String arguments)
   at OpenQA.Selenium.DriverFinder.BinaryPaths()
   at OpenQA.Selenium.DriverFinder.GetDriverPath()
   at OpenQA.Selenium.Chromium.ChromiumDriver.GenerateDriverServiceCommandExecutor(DriverService service, DriverOptions options, TimeSpan commandTimeout)
   at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)

Operating System

Windows Server 2022

Selenium version

4.21.0

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

Chrome 125

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

4.21.0

Are you using Selenium Grid?

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (5 by maintainers)

Commits related to this issue

Most upvoted comments

The problem is that you have a driver in your PATH:

Found chromedriver 125.0.6422.76 in PATH: C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\�e�X�g\\�V�X�e���e�X�g\\MyProject\\bin\\Debug\\net8.0\\chromedriver.exe"

Selenium-Manager detects this driver. Unfortunately, it cannot parse that driver’s path properly because of the Japanese characters. I’ve been debugging this problem, and I have found that it is caused by the execution of the command where in Windows through Selenium Manager. After much digging into the issue, I believe I found a solution.

So, the following Selenium Manager binary should fix the issue: selenium-manager-windows

@matsuda-dcom: Please download that file, uncompress it, and replace the resulting EXE with the one that is being used in your test:

C:\ProgramData\Jenkins.jenkins\workspace\テスト\システムテスト\MyProject\bin\Debug\net8.0\selenium-manager\windows\selenium-manager.exe

Please rerun your test and share the results here, thanks.

@bonigarcia Replaced with selenium-manager-windows No errors are output. My Jenkins job was successful! Thanks for the great fix.