Skip to content
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]: Selenium Server ignores Chrome binary location specified in Chrome options #11914

Closed
JohnChen0 opened this issue Apr 19, 2023 · 3 comments

Comments

@JohnChen0
Copy link
Contributor

What happened?

If I use Selenium Server 4.8.2 or 4.8.3 to start Chrome, the server ignores the Chrome binary path I specify in ChromeOptions object, and runs Chrome from the default system location instead. Selenium Server 4.8.1 did not have this issue.

How can we reproduce the issue?

First start a local standalone Selenium server, e.g., with the following command:


java -jar selenium-server-4.8.3.jar standalone

Then run the following Python script:

from selenium import webdriver
opt = webdriver.ChromeOptions()
opt.binary_location = '/path/to/chrome'
driver = webdriver.Remote('http://localhost:4444/wd/hub', options=opt)
driver.get('chrome://version')
input()
driver.quit()

While the chrome://version page is displayed, it shows (under "Command Line" heading") that Chrome is running from a default system location, instead of from the location specified in the script.

If I use selenium-server-4.8.1.jar instead, then the code works correctly. Bisecting Selenium code shows that the issue was introduced by 807bb7d. This commit adds a ChromeOption object in the stereotype capability. When this stereotype option is merged with the user-supplied option, the merge code (https://github.com/SeleniumHQ/selenium/blob/selenium-4.8.3-java/java/src/org/openqa/selenium/grid/node/config/SessionCapabilitiesMutator.java#L155) ignores the "binary" option supplied by the user.



### Relevant log output

```shell
N/A

Operating System

Have observed this on Linux and MacOS

Selenium version

Selenium Server 4.8.3; Selenium Python 4.5.0

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

Tested with Chrome 112.0.5615.121, though it should repro with any recent Chrome version

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

ChromeDriver 112.0.5615.49

Are you using Selenium Grid?

Selenium Server 4.8.3 running in standalone mode

@github-actions
Copy link

@JohnChen0, 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!

@diemol
Copy link
Member

diemol commented Apr 19, 2023

The fix will be part of 4.9.0, should come out in 1-2 days.

dev-ardi pushed a commit to dev-ardi/selenium that referenced this issue Apr 24, 2023
Copy link

github-actions bot commented Dec 9, 2023

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

@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants