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]: Running chrome driver with --remote-debugging-pipe makes dev_tools unavailable in ruby #13979

Closed
tubaxenor opened this issue May 20, 2024 · 5 comments

Comments

@tubaxenor
Copy link

What happened?

Passing --remote-debugging-pipe as chrome driver options removes debuggerAddress setting and cause driver.devtools to raise error.

This is expected behavior in chromedriver: https://chromium.googlesource.com/chromium/src/+/master/chrome/test/chromedriver/test/run_py_tests.py#5959

How can we reproduce the issue?

require 'selenium-webdriver'
require 'selenium/devtools'

options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
options.add_argument('--remote-debugging-pipe')
driver = Selenium::WebDriver.for :chrome, options: options

driver.devtools

# => undefined method `[]' for nil (NoMethodError)
# "http://#{capabilities['goog:chromeOptions']['debuggerAddress']}"
# ^^^^^^^^^^^^^^^^^^^

Relevant log output

3.3.1 :011 > options = Selenium::WebDriver::Chrome::Options.new
3.3.1 :012 > options.add_argument('--headless')
3.3.1 :013 > options.add_argument('--remote-debugging-pipe')
 => ["--headless", "--remote-debugging-pipe"]
3.3.1 :014 > driver = Selenium::WebDriver.for :chrome, options: options
 => #<Selenium::WebDriver::Chrome::Driver:0xf9e36fa01383a60 browser=:chrome_headless_shell>
3.3.1 :015 > driver.devtools
(irb):15:in `<main>': undefined method `[]' for nil (NoMethodError)

          "http://#{capabilities['goog:chromeOptions']['debuggerAddress']}"
                                                      ^^^^^^^^^^^^^^^^^^^
3.3.1 :016 >


### Operating System

macOS

### Selenium version

selenium-webdriver v4.21.0, selenium-devtools v0.125.0

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

Chrome 125.0.6422.61

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

Same as chrome

### Are you using Selenium Grid?

No
Copy link

@tubaxenor, 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 May 20, 2024

@tubaxenor, then do not add the flag? If it is the expected behavior, we cannot do much about it.

@tubaxenor
Copy link
Author

I see, but still wondering if there a way to obtain devtools connection from pipe...

The best I can get is the source code here: https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/devtools_pipe_handler.cc

Which seems like it's using internal thread to make the connection but would like to have some 👀 to double check there is not much we can do before closing this issue 🙇

@diemol
Copy link
Member

diemol commented May 20, 2024

You should probably reach out to the Chrome team to find out if there is a way to do that.

@diemol diemol closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
Copy link

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 github-actions bot locked and limited conversation to collaborators Jun 19, 2024
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