1

My StartSeleniumGridNode.bat file.

java -jar selenium-server-standalone-3.4.0.jar -role node -hub http://127.0.0.1:4444/grid/register ^
-browser "browserName=firefox,maxInstances=3,platform=WINDOWS" ^
-browser "browserName=chrome,maxInstances=2,platform=WINDOWS" -Dwebdriver.chrome.driver="D:\SeleniumGridPractice\drivers\chromedriver.exe"

This is the error i am getting in the console.

D:\SeleniumGridPractice>StartSeleniumGridNode.bat
D:\SeleniumGridPractice>java -jar selenium-server-standalone-3.4.0.jar -ro
le node -hub http://127.0.0.1:4444/grid/register -browser "browserName=firefox,m
axInstances=3,platform=WINDOWS" -browser "browserName=chrome,maxInstances=2,plat
form=WINDOWS" -Dwebdriver.chrome.driver="D:\SeleniumGridPractice\drivers\c
hromedriver.exe"
Exception in thread "main" com.beust.jcommander.ParameterException: Unknown opti
on: -Dwebdriver.chrome.driver=D:\SeleniumGridPractice\drivers\chromedriver
.exe
        at com.beust.jcommander.JCommander.parseValues(JCommander.java:742)
        at com.beust.jcommander.JCommander.parse(JCommander.java:282)
        at com.beust.jcommander.JCommander.parse(JCommander.java:265)
        at com.beust.jcommander.JCommander.<init>(JCommander.java:210)
        at org.openqa.grid.selenium.GridLauncherV3$3.setConfiguration(GridLaunch
erV3.java:267)
        at org.openqa.grid.selenium.GridLauncherV3.buildLauncher(GridLauncherV3.
java:155)
        at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:75)`

D:\SeleniumGridPractice>

NB: StartSeleniumGridHub.bat is running perfectly. Also there is no issues with Firefox.

  • In the bat file you mentioned about `Dwebdriver.chrome.driver="D:\Vizrt\SeleniumGridPractice\drivers\chromedriver.exe"` but your error stacktrace mentions some other location. Can you cross check once? Thanks – undetected Selenium May 22 '17 at 20:06
  • Your error stacktrace mentions about `-Dwebdriver.chrome.driver="D:\SeleniumGridPractice\drivers\c hromedriver.exe"` please check once. Thanks – undetected Selenium May 22 '17 at 20:09
  • Can you take a look to this approach https://stackoverflow.com/a/43733249 – user2528891 May 22 '17 at 23:11
  • Sorry my bad. Updated. – Kazi Safaet Mahmud Auvi May 23 '17 at 03:34
  • @KaziSafaetMahmudAuvi I am still not sure about your exact requirement. Your subject mentions `Chromedriver setup in selenium grid 3 node` which is the basic step but you are trying to setup a Node with added Capabilities as in `-browser "browserName=firefox,maxInstances=3,platform=WINDOWS"`. Any reason to avoid the default Capability & settings? – undetected Selenium May 23 '17 at 05:34
  • @Dev Actually I just started learning Grid. So things are not that much clear to me. So what do you prefer in this case by keeping the capabilities in a json file or else? – Kazi Safaet Mahmud Auvi May 23 '17 at 08:44
  • @KaziSafaetMahmudAuvi Well :) you already got an answer Accepted. Let the Question RIP :) Thanks – undetected Selenium May 23 '17 at 08:46

1 Answers1

1

Please change

java -jar selenium-server-standalone-3.4.0.jar -role node -hub http://127.0.0.1:4444/grid/register -browser "browserName=firefox,maxInstances=3,platform=WINDOWS" -browser "browserName=chrome,maxInstances=2,platform=WINDOWS" -Dwebdriver.chrome.driver="D:\SeleniumGridPractice\drivers\chromedriver.exe"

to

java -Dwebdriver.chrome.driver="D:\SeleniumGridPractice\drivers\chromedriver.exe" -jar selenium-server-standalone-3.4.0.jar -role node -hub http://127.0.0.1:4444/grid/register -browser "browserName=firefox,maxInstances=3,platform=WINDOWS" -browser "browserName=chrome,maxInstances=2,platform=WINDOWS"

and try again.

Explanation :

JVM arguments (the ones that begin with -D) are supposed to be provided before -jar argument. But since you provided it after -jar instead of it being treated as a JVM argument, its being fed as a command line argument to the selenium-server standalone jar.

Krishnan Mahadevan
  • 14,121
  • 6
  • 34
  • 66