问题
I am using selenium grid for automated testing. I have followed the official documents to install the grid. But after running the run-demo-in-parallel, the test casses fail with the following error in the target folder.
Parameter #1 Parameter #2 Parameter #3 Parameter #4
localhost 4444 *firefox http://images.google.com
**Could not contact Selenium Server; have you started it on 'localhost:4444'** ?
Read more at http://seleniumhq.org/projects/remote-control/not-started.html Connection refused: connect
com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:86)
at com.thoughtworks.selenium.grid.tools.ThreadSafeSeleniumSessionStorage.startSeleniumSession(ThreadSafeSeleniumSessionStorage.java:26)at com.thoughtworks.selenium.grid.demo.WebTestForASingleBrowser.domme(WebTestForASingleBrowser.java:51)
Can you please tell me what the issue can be ? I am using a windows7 machine. With java jdk and jre 1.6. Selenium version 1.0.8 . Selenium stand alone server -2.5.0. Is there any more information i can give ?
回答1:
open up taskmanager and see if there is a process with the name java.exe or javaw.exe running if that is not the case then your Sel Grid has not yet been started. Please open (double click) the selenium-server-standalone-2.5.0.jar
file then again statup taskmanager and make sure your grid is up and running and then try.
if the process is nt started It might be the case that your grid is not able to start to some reason I would suggest opening up a command prompt window and run the following command:
java -jar selenium-server-standalone-2.5.0.jar -role hub
Note: You need to be in the directory where the jar file is for the above command to work else cmd will throw an error saying file not found
Please let me know if you need more help.
来源:https://stackoverflow.com/questions/7331931/selenium-grid-demo-test-cases-fail