Message: OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL when using Chrome Headles
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:


This seems to be the same issue as https://github.com/SeleniumHQ/selenium/issues/5457 which was closed without resolution.
@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.
Do any one have an idea how to solve this issue
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
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...
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.