简体   繁体   中英

linux - how to run a selenium-server-standalone?

I created a .sh file with the following content:

java -jar selenium-server-standalone-3.3.1.jar -Dwebdriver.gecko.driver=./opt/webdrivers/geckodriver

I already made sure that the file /opt/webdrivers/geckodriver has permission to get executed by using chmod 770 and I even changed the user to root.

But this is the result if I execute my .sh file:

root@mycomputer:/opt/Selenium# ./selenium.sh
Exception in thread "main" com.beust.jcommander.ParameterException: Unknown option: -Dwebdriver.gecko.driver=./opt/webdrivers/geckodriver
    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$1.setConfiguration(GridLauncherV3.java:227)
    at org.openqa.grid.selenium.GridLauncherV3.buildLauncher(GridLauncherV3.java:155)
    at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:75)

What am I doing wrong?

You have to specify the parameters right after -jar :

java -jar -Dwebdriver.gecko.driver=./opt/webdrivers/geckodriver selenium-server-standalone-3.3.1.jar

Note : This is a knowledge sharing answer ( share your knowledge, Q&A-style )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM