0

I have downloaded the Selenium server 3.0.0 into my C:\SeleniumGrid\ folder and setup the hub and node using separate command consoles. I've included the logs below. When running my automation scenario on my machine (same machine as the selenium grid) I get the following run-time error.

Any help appreciated.

Hub console

C:\SeleniumGrid>java -jar selenium-server-standalone-3.0.0.jar -role hub -port 666

14:46:32.026 INFO - Selenium build info: version: '3.0.0', revision: '350cf60'
14:46:32.026 INFO - Launching Selenium Grid hub
2017-08-07 14:46:32.459:INFO::main: Logging initialized @627ms
14:46:32.466 INFO - Will listen on 666
2017-08-07 14:46:32.494:INFO:osjs.Server:main: jetty-9.2.15.v20160210
2017-08-07 14:46:32.513:INFO:osjsh.ContextHandler:main: Started 
o.s.j.s.ServletContextHandler@1baf4f0{/,null,AVAILABLE}
2017-08-07 14:46:32.523:INFO:osjs.ServerConnector:main: Started ServerConnector@ 1606c0b{HTTP/1.1}{0.0.0.0:666}
2017-08-07 14:46:32.523:INFO:osjs.Server:main: Started @692ms
14:46:32.524 INFO - Nodes should register to http://10.6.122.48:666/grid/register/
14:46:32.524 INFO - Selenium Grid hub is up and running
14:49:56.259 INFO - Registered a node http://10.6.122.48:5555

Launching a new console window I run the following

Node console

c:\SeleniumGrid>java -jar selenium-server-standalone-3.0.0.jar -role node -hub http://localhost:666/grid/register

14:56:02.397 INFO - Selenium build info: version: '3.0.0', revision: '350cf60'
14:56:02.398 INFO - Launching a Selenium Grid node
2017-08-07 14:56:02.665:INFO::main: Logging initialized @426ms
14:56:02.706 INFO - Driver class not found: com.opera.core.systems.OperaDriver
14:56:02.707 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
Unable to create new instances on this machine.
14:56:02.707 INFO - Driver class not found: com.opera.core.systems.OperaDriver
14:56:02.707 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
14:56:02.711 INFO - Driver provider org.openqa.selenium.safari.SafariDriverregistration is skipped:registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform WIN8_1
2017-08-07 14:56:02.732:INFO:osjs.Server:main: jetty-9.2.15.v20160210
2017-08-07 14:56:02.747:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@1ef2d72{/,null,AVAILABLE}
2017-08-07 14:56:02.757:INFO:osjs.ServerConnector:main: Started ServerConnector@4b8173{HTTP/1.1}{0.0.0.0:5555}
2017-08-07 14:56:02.757:INFO:osjs.Server:main: Started @518ms
14:56:02.758 INFO - Selenium Grid node is up and ready to register to the hub
14:56:02.762 INFO - Starting auto registration thread. Will try to register every 5000 ms.
14:56:02.762 INFO - Registering the node to the hub: http://localhost:666/grid/register
14:56:02.776 INFO - The node is registered to the hub and ready to use

C# code sample, using the remote Web Driver

public class WebDriverFactory : IWebDriverFactory
{
    public IWebDriver Get()
    {
        var cap = DesiredCapabilities.Chrome();
        cap.Platform = new Platform(PlatformType.Vista);
        var driver = new RemoteWebDriver(new Uri("http://10.6.122.48:5555/wd/hub"), cap);

        return driver;
    }
}

Screen shot of the run-time C# error

C# run time error

Updates

  1. The hub/ node and automation tests are currently all on the same machine.
  2. I can open up a browser and see the Selenium page here http://10.6.122.48:5555
  3. Changed C# to use the following: new RemoteWebDriver(new Uri("http://10.6.122.48:666/wd/hub"), cap) Received following error message after applying this change

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 ... in D:\Projects\UAT Automation\... 15
at ..ctor() in D:\...cs:line 33
at ..ctor() in D:\...cs:line 21
user7558986
  • 65
  • 2
  • 8
  • You seem to be connecting to the node instead of connecting to the Hub. Please change your URI Port number from `5555` to `666` (You might want to fix the port number too). The machine where your .NET test resides and the machine where the node resides, are they the same machine or are these different machines ? Have you tried opening the URL `http://10.6.122.48:5555` from a browser and see if you are able to see the console (Please open the URL on the same machine from where your test runs). Your timeout error indicates that perhaps a firewall blockage is involved. – Krishnan Mahadevan Aug 08 '17 at 02:28
  • Just to clarify, are you asking me to change the port used in C# or when I run the console commands? – user7558986 Aug 08 '17 at 10:07
  • No. You need to change the port in your C# code to use the Grid url and not the node url. I had asked you to try and load `http://10.6.122.48:5555` from your machine which runs C# to check if there are any firewall blockages. – Krishnan Mahadevan Aug 08 '17 at 10:10
  • Okay, I can successfully see the Selenium grid page when browsing 10.6.122.48:5555. I've updated my question with your suggestions and the error message I receive after making the changes suggested by you – user7558986 Aug 08 '17 at 10:29

0 Answers0