--remote-debugging-port argument causes timeout on connection headless chrome
Reported by
peterhug...@gmail.com,
Sep 20 2017
|
||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36
Steps to reproduce the problem:
1. Adding the following arguments into Chrome options
2.
ChromeOptions headless_option = new ChromeOptions();
headless_option.AddArgument("--headless");
headless_option.AddArgument("--hide-scrollbars");
headless_option.AddArgument("--remote-debugging-port=9222");
headless_option.AddArgument("--disable-gpu");
headless_option.BinaryLocation = string.Format(@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe");
driver = new ChromeDriver(headless_option);
What is the expected behavior?
Navigating to localhost:9222 displays debug options for the page being navigated to
What went wrong?
'The HTTP request to the remote Webdriver server for URL http://localhost:58867/session timed out after 60 seconds'
After running the program I am able to navigate to http://127.0.0.1:9222/devtools/inspector.html?ws=127.0.0.1:9222/devtools/page/aa1142e1-9e06-4bbc-b380-78d1b7657804
Which shows the debug port is open, and working, but the chrome instance cannot connect.
If I omit the line for headless_option.AddArgument("--remote-debugging-port=9222"); Then headless chrome runs fine, but I am unable to debug
Did this work before? No
Chrome version: 61.0.3163.91 Channel: stable
OS Version: 10.0
Flash Version:
I'm running this in Visual Studio, using the C# bindings for Selenium Webdriver
,
Oct 3 2017
It looks like it's trying to connect to a different port from remote debugging port. Adding also WebDriver folk to check
,
Oct 3 2017
,
Oct 5 2017
peterhughes0@, the right way to do is as follows:
1) Launch Headless Chrome in command prompt
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --headless --disable-gpu --remote-debugging-port=9222
2) Set debuggerAddress like below:
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("debuggerAddress", "127.0.0.1:9222");
WebDriver driver = new ChromeDriver(options);
driver.get("https://www.google.com/");
Here, using "debuggerAddress" capability, Chromedriver will establish connection with Headless Chrome launched in step 1).
Hope this helps!
,
Oct 5 2017
WontFix as per comment 4. Thanks!
,
Oct 6 2017
I believe the method setExperimentalOption is a Java binding method, and does not exist in the C# binding. The equivalent for C# looks like: chromeOptions.DebuggerAddress = "127.0.0.1:9222"; I have tried this and still receive the timeout. I will keep trying |
||||
►
Sign in to add a comment |
||||
Comment 1 by krajshree@chromium.org
, Sep 21 2017