selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Message: OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL when using Chrome Headles

Open ghost opened this issue 8 years ago • 6 comments

Meta -

OS: Windows 10 Selenium Version: 3.13.1 Browser: Chrome Headless Browser Version: 68.0.3440.84 64bit

Expected Behavior -

Tests run in Headless mode

Actual Behavior -

Steps to reproduce -

I am starting chromedriver like this:

public static IWebDriver GetDriver()
        {
            var driverName = ConfigurationManager.AppSettings["Driver"];
            IWebDriver driver;

            switch (driverName.ToLowerInvariant())
            {
                case "chrome":
                    var options = new ChromeOptions();

                    if (ConfigurationManager.AppSettings["Headless"] == "true")
                    {
                        options.AddArgument("window-size=1920,1080");
                        options.AddArgument("headless");
                        options.AddArgument("disable-gpu");
                        options.AddArgument("no-sandbox");
                    }

                    driver = new ChromeDriver(options);
                    break;
                default:
                    throw new NotImplementedException();
            }

            return driver;
        }

When I use Chrome standalone everything works ok. When use headless I get timeout: image

image

ghost avatar Aug 01 '18 12:08 ghost

This seems to be the same issue as https://github.com/SeleniumHQ/selenium/issues/5457 which was closed without resolution.

SCarlAdams avatar Aug 29 '18 13:08 SCarlAdams

@SCarlAdams No, they’re not the same issue. The other issue was in creating a session; this one relates to navigating to a url once a session has been created. Nevertheless, it’s difficult to see how this issue is a Selenium one as opposed to a Chrome or chromedriver.exe one. All the language bindings are doing is firing off an http request to chromedriver.exe, which doesn’t issue a response to the request before the timeout.

jimevans avatar Aug 29 '18 13:08 jimevans

Do any one have an idea how to solve this issue

kambleaa007 avatar Dec 03 '18 09:12 kambleaa007

I bumped into the same issue (Chrome v71, Selenium.WebDriver.ChromeDriver v2.45). Adding the following lines fixed it for me:

options.AddArgument("proxy-server='direct://'");
options.AddArgument("proxy-bypass-list=*");

Full list of options:

ChromeOptions options = new ChromeOptions();
options.AddArgument("headless");
options.AddArgument("no-sandbox");
options.AddArgument("proxy-server='direct://'");
options.AddArgument("proxy-bypass-list=*");

More information about Network Settings: https://www.chromium.org/developers/design-documents/network-settings

alexeypt avatar Jan 04 '19 22:01 alexeypt

I bumped into the same issue (Chrome v71, Selenium.WebDriver.ChromeDriver v2.45). Adding the following lines fixed it for me:

options.AddArgument("proxy-server='direct://'");
options.AddArgument("proxy-bypass-list=*");

Full list of options:

ChromeOptions options = new ChromeOptions();
options.AddArgument("headless");
options.AddArgument("no-sandbox");
options.AddArgument("proxy-server='direct://'");
options.AddArgument("proxy-bypass-list=*");

More information about Network Settings: https://www.chromium.org/developers/design-documents/network-settings

This worked for me too! You made my day after 2 weeks of ignorance...

dodo1292 avatar Mar 25 '20 19:03 dodo1292

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

lock[bot] avatar May 20 '20 23:05 lock[bot]