【发布时间】:2017-06-24 19:15:57
【问题描述】:
我正在尝试使用remotewebdriver 从 UNIX 机器上远程启动 Firefox。
我尝试在 PATH 中添加 Firefox,如下所示:
$ echo $PATH
/cygdrive/c/Program Files (x86)/Google/Chrome/Application/:/cygdrive/c/Program Files (x86)/Mozilla Firefox/
但浏览器仍然无法启动,因为geckodriver.exe 试图在 Windows 默认路径中查找 Firefox。
这是来自 selenium hub 的日志:
1486475449767 mozprofile::profile INFO 使用配置文件路径 C:\cygwin64\tmp\rus
t_mozprofile.Rmyr2i85U1HV1486475449774 geckodriver::marionette INFO 启动浏览器 C:\Program Files (x86)\Mozilla Firefox\firefox.exe
我还尝试在启动 selenium 节点时添加以下属性:
-Dwebdriver.firefox.bin="/cygdrive/c/Program Files (x86)/Mozilla Firefox/"
但是抛出了异常:
原因:org.openqa.selenium.WebDriverException: 'webdriver.firefox.bin' 属性集,但无法找到请求的二进制文件:/cygdrive/c/Program Files (x86)/Mozilla Firefox/.exe
.....
.....
异常:无法初始化类 org.openqa.selenium.firefox.internal.Executable
有没有办法提供firefox安装文件夹的路径?
编辑:
提供参数后:
-Dwebdriver.gecko.driver=geckodriver.exe -Dwebdriver.firefox.bin="firefox/firefox.exe"
执行卡在:
1486534065121 mozprofile::profile INFO 使用配置文件路径 C:\cygwin64\tmp\rust_mozprofile.eqdfIaNAGjDu 1486534065135 geckodriver::marionette INFO 启动浏览器>C:\cygwin64\home\Administrator\firefox\firefox.exe
1486534065198 geckodriver::marionette INFO 连接到 localhost:56702 上的 Marionette
1486534068740 Marionette INFO 监听端口 56702
【问题讨论】:
标签: selenium cygwin selenium-grid remotewebdriver selenium-grid2