未知选项:在Mac上独立运行Selenium服务器时,-Dwebdriver.chrome.driver

未知选项:在Mac上独立运行Selenium服务器时,-Dwebdriver.chrome.driver

问题描述:

我试图在MAC上手动运行selenium server standalone,然后在Chrome浏览器中使用实习生运行我的测试.正如我在《实习用户指南》中所建议的那样:

I was trying to manually run selenium server standalone on MAC and then run my tests with intern-runner in Chrome browser. As I've been advised on intern User Guide:

要将ChromeDriverIEDriver与Selenium服务器一起使用,驱动程序可执行文件必须放在环境PATH中的某个位置,或者必须使用-Dwebdriver.chrome.driver (ChromeDriver)在启动Selenium服务器时标记."

"To use ChromeDriver and IEDriver with a Selenium server, the driver executable must either be placed somewhere in the environment PATH, or their locations must be given explicitly to the Selenium server using the -Dwebdriver.chrome.driver (ChromeDriver) and -Dwebdriver.ie.driver (IEDriver) flags upon starting the Selenium server."

我启动了Selenium服务器,并在我的计算机上放置了chrome驱动程序的路径,但是出现了错误:

I started the Selenium server and put path to chrome driver on my machine, but got error:

未知选项:-Dwebdriver.chrome.driver"

关于为什么seleinum无法识别选项的任何想法?

any idea on why seleinum unable to recognize the options?

在使用硒独立服务器从命令行运行chrome webdriver/IE webDriver时,还有其他解决方案吗?

Is there any other solution on how to run chrome webdriver/IE webDriver from command line with selenium standalone server?

可以将驱动程序可执行文件放在MAC上的环境PATH中吗?

Where the driver executable could be placed in the environment PATH on MAC?

我能够使用以下命令单独运行chrome驱动程序,而不会出现任何问题:

I was able to run chrome driver separately with out any issues using:

./node_modules/.bin/chromedriver --port=4444 --url-base=wd/hub  

对于selenium3,您需要首先使用Dwebdriver.chrome.driver选项.

For selenium3 you need to use Dwebdriver.chrome.driver option first.

java -Dwebdrive.chrome.driver=path_to_chrome_driver -jar selenium_server_file

为避免出现路径问题,最好将两个文件下载到同一目录中,然后从那里运行.

To avoid any path issues better download both files in the same directory and run from there.

示例:

java -Dwebdrive.chrome.driver=chromedriver -jar selenium-server-standalone-3.0.1.jar

还安装了Chrome浏览器.

Also have Chrome browser installed.

是驱动器而不是驱动器

Is drive instead of driver