Error initializing RemoteWebDriver when Hub is hosted in a controlled network

82 views
Skip to first unread message

techie monk

unread,
Apr 24, 2012, 5:33:51 PM4/24/12
to webd...@googlegroups.com
Hi,

I am running into an issue while trying to initialize RemoteWebDriver when using with SeleniumGrid. I started the hub, registered the node
with it and verified that it shows up in the grid console. When I execute my test it fails while trying to instantiate RemoteWebDriver.

HUB, NODE deployment
--------------------
Hub is running on a host in a controlled network (say NW1) listening at 4444. Opening additional ports might be blocked in this network.
Node is running on a host in a different network (say NW2) listening at 5555.

Does some one know what might be going wrong? How does the session get established between the node and the hub? Would the grid spawn another process on a separate port (on the same host as hub) with which the remote web driver session would be established? If yes, what would be the default port for this process?

Navigating through the stack trace I see the error happening in RemoteWebDriver.class at this method call
    Response response = execute(DriverCommand.NEW_SESSION, ImmutableMap.of("desiredCapabilities", desiredCapabilities));

No issues when I run the test with both node, hub running on the same host in NW2. It is when the hub is in NW1 and node in NW2 that I am seeing this issue.


STACK TRACE
-----------
org.openqa.selenium.WebDriverException: Build info: version: '2.20.0', revision: '16008', time: '2012-02-28 15:00:40'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-38-generic', java.version: '1.6.0_27'
Driver info: driver.version: RemoteWebDriver
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:170)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:123)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:438)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:139)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:94)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:102)
    .....
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Build info: version: '2.20.0', revision: '16008', time: '2012-02-28 15:00:40'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-38-generic', java.version: '1.6.0_27'
Driver info: driver.version: unknown
    at hudson.remoting.Command.<init>(Command.java:51)
    at hudson.remoting.Channel$CloseCommand.<init>(Channel.java:842)
    at hudson.remoting.Channel$CloseCommand.<init>(Channel.java:840)
    at hudson.remoting.Channel.close(Channel.java:907)
    at hudson.remoting.Channel.close(Channel.java:890)
    at hudson.slaves.SlaveComputer.closeChannel(SlaveComputer.java:500)
    at hudson.slaves.SlaveComputer.kill(SlaveComputer.java:481)
    at hudson.model.AbstractCIBase.killComputer(AbstractCIBase.java:84)
    at jenkins.model.Jenkins.cleanUp(Jenkins.java:2455)
    at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:71)
    at jenkins.model.Jenkins$19.run(Jenkins.java:3056)

Appreciate any help.

Thanks

Krishnan Mahadevan

unread,
Apr 25, 2012, 3:38:05 AM4/25/12
to webd...@googlegroups.com
After you spawned the hub (on NW1) and node (on NW2), I am guessing you have confirmed on the grid console, that the node is infact registered to the hub.

When you spawn the node on NW2, you would basically be telling the node to register itself on the port of the hub using the parameter -hub http://machineName:4444/grid/register (assuming the hub is listening on the default port 4444)

If the node was able to register itself to the hub, then I doubt if there are any network blockages. Your tests would be targetting the hub and it is the hub that delegates the web request to the node.

Your stack trace has references to jenkins. Are you using the Jenkins plugin for selenium ? perhaps it is a problem with the jenkins plugin and has got nothing to do with the grid at all.

What happens when you just do the below on the two machines in different network ?

java -jar selenium-standalone-2.21.0.jar -role hub (on machine 1 running in NW1)
java -jar selenium-standalone-2.21.0.jar -role node -hub http://machine1:4444/grid/register -port 5555 (on machine 2 running in NW2)

Check the grid console on machine 1 and confirm that the node running on machine2 is registered to it.

now try running a simple test which just invokes some web page and let us know what you see.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"


--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

techie monk

unread,
Apr 25, 2012, 1:25:39 PM4/25/12
to webd...@googlegroups.com
Thanks for responding Krishnan.

My set up is just like what you mentioned above, I get the above errors in that scenario only. I am not using Jenkins plugin for selenium, I just kick off the job using Jenkins. I manually launched the hub and node.

Hub  - listening at port 4444
Node - registered to Hub and is using port 5555

Do you see anything else that might impact the set up?

Thanks

Mike Riley

unread,
Apr 25, 2012, 7:57:47 PM4/25/12
to webd...@googlegroups.com
Can you please show the command lines you used for the hub and the node?

Mike
To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.

techie monk

unread,
Apr 25, 2012, 8:32:36 PM4/25/12
to webd...@googlegroups.com
Krishnan,

I found the reason. There was another node that was registered to the hub and the tests were getting directed to that host. This node was not behaving correctly and was seeing those failures.

By setting the capability while instantiating the RemoteWebdriver I was able to direct the test to the correct node and it worked.

Thanks for your input.
Reply all
Reply to author
Forward
0 new messages