Skip to content

RemoteWebDriver cannot connect to Selenium Grid 4 #9277

@stawr93

Description

@stawr93

🐛 Bug Report

The exception is thrown on the RemoteWebDriver object instantiation when application targeting .Net Framework 4.8.

To Reproduce

Run following code in an application targeting net48:

var chromeOpts = new ChromeOptions();

var driver = new RemoteWebDriver(new Uri("http://selenium-grid:4444/wd/hub/"), chromeOpts);

driver.Navigate().GoToUrl("http://application-url");

driver.Quit();

You'll get exception like:

Unhandled Exception: OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL http://selenium-grid:4444/wd/hub/session timed out after 60 seco
nds. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at OpenQA.Selenium.Remote.HttpCommandExecutor.<MakeHttpRequest>d__30.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   --- End of inner exception stack trace ---
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, DriverOptions options)
   at ConsoleApplication1.Program.Main(String[] args) in C:\Projects\Test\SeleniumTest\ConsoleApplication1\ConsoleApplication1\Program.cs:line 13

Expected behavior

A RemoteWebDriver created successfully.

Test script or set of commands reproducing this issue

See above.

Environment

OS: Windows 10
Browser: any
Browser version: any
Browser Driver version: any
Language Bindings version: .NET Selenium.WebDriver 4.0.0-beta1
Selenium Grid version (if applicable): docker image selenium/hub:4.0.0-beta-2-prerelease-20210312

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions