Reputation: 65
I've executed the following hub and node commands in my windows command prompts. I can see this is working as I get the grid console when browsing http://localhost:4441/grid/console
C:\seleniumserver\java -jar selenium-server-standalone-3.4.0.jar -role hub -port 4441
C:\seleniumserver\java -jar selenium-server-standalone-3.4.0.ja -role wd -hub http://localhost:4441/grid/register
My automation code has the following C# code.
C# code snippet
var capabilities = DesiredCapabilities.Chrome();
capabilities.Platform = Platform.CurrentPlatform;
IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), capabilities);
When I run run the automation I get the following error message
Error message received
An exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll but was not handled in user code
Additional information: The HTTP request to the remote WebDriver server for URL http://localhost:4444/wd/hub/session timed out after 60 seconds.
Any suggestions what I'm doing wrong please? First time setting this up
Many thanks,
Update after comments
made the following change
var capabilities = DesiredCapabilities.Chrome();
capabilities.Platform = Platform.CurrentPlatform;
IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4441/wd/hub"), capabilities);
Error message
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) 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) at myfile.ctor() in C:\Projects\UAT Automation\myfile.cs:line 43 at ....ctor() in C:\Projects\UAT Automation...cs:line 21
Upvotes: 0
Views: 2748
Reputation: 14746
You are starting your hub in the port 4441
but you are trying to connect to 4444
using
IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), capabilities);
Please change your instantiation code to
IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4441/wd/hub"), capabilities);
and try again.
Upvotes: 1