1

I am newbie to selenium. I am trying to run some test cases, for this I tried to start selenium hub and node..Following is batch file to start hub and node.

set path=%path%;C:\SeleniumConfig;C:\Program Files (x86)\Java\jdk1.7.0_21\bin;C:\Program Files (x86)\Java\jre1.6.0_45\lib;
set webdriver.ie.driver=C:\SeleniumConfig\IEDriverServer.exe
start java -jar selenium-server-standalone-2.42.2.jar -role hub -hubConfig config-hub.json
start java -jar selenium-server-standalone-2.42.2.jar -role node -nodeConfig config-node.json -hub http://localhost:4444/grid/register

When I tried to run hub and node using following command , I dont see any issue on command prompt. but dont see anythings is running on http://MyHost:4444/

 "start java -jar selenium-server-standalone-2.42.2.jar -role hub -hubConfig config-hub.json"

With the above command some window opens and close immediately.
Please advice

Raje
  • 3,285
  • 15
  • 50
  • 70
  • insert `pause` to the end of the bat file and remove `start` before `java -jar`, this will let you see what error it thrown before it closed – German Petrov Sep 15 '14 at 11:51
  • Thanks for help.. After updating I am getting following NoClassDefError exception.. C:\SeleniumConfig>java C:\SeleniumConfig\selenium.jar -role hub -hubConfig C:\Se leniumConfig\config-hub.json Exception in thread "main" java.lang.NoClassDefFoundError: C:\SeleniumConfig\sel enium/jar – Raje Sep 15 '14 at 12:12
  • seems that this is it: http://stackoverflow.com/questions/5134953/noclassdeffounderror-in-java :) – German Petrov Sep 15 '14 at 12:14
  • Sorry.. Bymistake "-jar" was remove from this command. actual issue is "Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version n umber in .class file" – Raje Sep 15 '14 at 12:42
  • then it can be this: http://stackoverflow.com/questions/7281767/java-lang-unsupportedclassversionerror-bad-version-number-in-class-file :) – German Petrov Sep 15 '14 at 12:52
  • Its works.. Somehow "set path=%path%;C:\SeleniumConfig;C:\Program Files (x86)\Java\jdk1.7.0_21\bin; " not overriding system path. In system path java 1.5 was set, so it picking same i.e 1.5. Now runnning command from JAVA_HOME\bin\javae.exe .. so it picks 1.7 java. – Raje Sep 15 '14 at 14:02
  • it's great! :) good luck – German Petrov Sep 15 '14 at 14:24

1 Answers1

0

selenium-server-standalone-2.42.2.jar file must be at same path . Or you can give jar file path. e.g. start java -jar C:/selenium-server-standalone-2.42.2.jar -role ......

test7
  • 63
  • 6
  • I tried to run "start java C:\SeleniumConfig\selenium-server-standalone-2.42.2.jar -role hub -hubConfig C:\SeleniumConfig\config-hub.json" but no luck... its opens some window and close instantly.. d – Raje Sep 15 '14 at 11:43
  • Please run your batch file from cmd , so that you can see exact error – test7 Sep 15 '14 at 11:55