Question

I am having problems getting the Selenium Grid demos to work. I try to run the tests in sequence, and although they run they all fail, without any browser being started. I have tried to run the tests with Firefox and Chrome and got the same result both times.

I followed all the instructions on this page (getting started) and installed Java jdk1.7.0_15, apache-ant-1.8.4 and selenium-grid-1.0.8 (which is apparently the current release, although I have seen Grid2 mentioned?).

I am able to successfully run the command

ant sanity-check

and have the grid compile. And then I move onto the demo page:

ant launch-hub

and I am able to view the hub at localhost:4444/console

ant launch-remote-control

and I see the available browser appear on my hub.

When I run

ant run-demo-in-sequence

The available remote control now appears as an active control in the hub and the tests run but all 4 fail. Firefox does not open and I don't see any new browsers open.

When I navigate to the target/reports/index.html page (located in the grid directory) I am able to find the following error, which is the same for each of the failed tests:

java.lang.RuntimeException: Could not start Selenium session: ERROR: Could not retrieve a new session at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89) at com.thoughtworks.selenium.grid.tools.ThreadSafeSeleniumSessionStorage.startSeleniumSession(ThreadSafeSeleniumSessionStorage.java:26) at com.thoughtworks.selenium.grid.demo.WebTestForASingleBrowser.domme(WebTestForASingleBrowser.java:51) at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217) at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152) at org.apache.tools.ant.taskdefs.Java.run(Java.java:771) at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221) at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135) at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:392) at org.apache.tools.ant.Target.performTasks(Target.java:413) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.Main.runBuild(Main.java:811) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: com.thoughtworks.selenium.SeleniumException: ERROR: Could not retrieve a new session at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97) at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91) at com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:262) at com.thoughtworks.selenium.HttpCommandProcessor.start(HttpCommandProcessor.java:223) at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:81) ... 50 more ... Removed 29 stack frames

whilst the output in the CMD window where I launched the test reads as:

run-demo-in-sequence:
     [java] [Parser] Running:
     [java]   Selenium Grid Demo In Sequence
     [java]
     [java]
     [java] ===============================================
     [java] Selenium Grid Demo In Sequence
     [java] Total tests run: 4, Failures: 4, Skips: 0
     [java] ===============================================
     [java]

BUILD FAILED
C:\Program Files\selenium-grid-1.0.8-bin\selenium-grid-1.0.8\build.xml:116: Java
 returned: 1

Total time: 1 minute 33 seconds

My Firefox version is 18.0.2. Also, I have seen Selenium-standalone.. mentioned in other similar questions but that is not mentioned anywhere in the tutorial I am following, do I need that?

Can anyone help get the demo working and explain where I am going wrong?

Was it helpful?

Solution

Selenium Grid 1.x is no longer in development. You should use Grid 2.0 which is mentioned here - https://code.google.com/p/selenium/wiki/Grid2

You are getting this error because, the 1.08 jar doesnt support latest versions of firefox.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top