问题描述
我试图在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:
我启动了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.
这篇关于未知选项:在Mac上独立运行Selenium服务器时,-Dwebdriver.chrome.driver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!