指定selenium-standalone的chromedriver路径
Specify chromedriver path to selenium-standalone
我正在尝试启动硒独立服务器(https://www.npmjs.com/package/selenium-standalone),它抛出一个错误:
14:19:09 /usr/local/lib/node_modules/selenium-standalone/bin/selenium-standalone:54
14:19:09 throw err;
14:19:09 ^
14:19:09 Error: Missing /usr/local/lib/node_modules/selenium-standalone/.selenium/chromedriver/2.18-x64-chromedriver
14:19:09 at /usr/local/lib/node_modules/selenium-standalone/lib/check-paths-existence.js:15:20
14:19:09 at Object.cb [as oncomplete] (fs.js:169:19)
14:19:09 Build step 'Execute shell' marked build as failure
selenium服务器正在寻找路径
上的chromedriver默认情况下/usr/地方/lib/node_modules/selenium-standalone/.selenium chromedriver/2.18 -x64-chromedriver
。
是否可以在运行服务器时在命令行指定chromedriver位置?比如:
selenium-standalone -Dwebdriver.chrome.driver=<path_to_chromedriver> start
您可能需要先安装它!
➜ ~ selenium-standalone install
----------
selenium-standalone installation starting
----------
---
selenium install:
from: https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar
to: /usr/local/lib/node_modules/selenium-standalone/.selenium/selenium-server/2.53.0-server.jar
---
chrome install:
from: https://chromedriver.storage.googleapis.com/2.21/chromedriver_mac32.zip
to: /usr/local/lib/node_modules/selenium-standalone/.selenium/chromedriver/2.21-x64-chromedriver
selenium-standalone installation [================== ] 91% 8.2s
selenium-standalone提供这个命令来帮助您下载和安装chromedriver。此外,它还提供了用于设置和下载selenium、chromedriver和架构的不同选项的命令(我没有找到设置路径的命令)
# choose selenium version
selenium-standalone install --version=2.45.0 --baseURL=https://selenium-release.storage.googleapis.com
# choose chrome driver version
selenium-standalone install --drivers.chrome.version=2.15 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com
# choose ie driver architecture
selenium-standalone start --drivers.ie.arch=ia32 --drivers.ie.baseURL=https://selenium-release.storage.googleapis.com
相关文章:
- Javascript:使用绝对路径设置img src
- 如何在d3.js中返回路径的y坐标
- 复制图像路径以单击它
- 从模块内部访问Express装载路径
- JS文件的路径正在消失
- 使用onclick绘制SVG路径
- jpm的默认Firefox路径没有'不起作用
- 如何使用jquery将base64图像路径转换为真实路径
- 可以用'吗/'在相对路径中
- Canvas+svg路径动画,在路径中的特定点暂停一段时间,然后继续
- 将Windows文件路径组织到文件夹中
- Ajax URL路径未替换当前URL
- 如何使用Javascript上传给定路径的文件
- 如何将要单独填充的每个HTML画布路径/形状分开
- 请求准备一个文件并返回路径,允许用户在准备好时下载
- 动态路径用于流星/铁路由器
- 在ng中给出文件路径包括什么
- react路由器使用简单的javascript路由器配置来处理不匹配的路径
- 如何设置SVG路径的样式以拍摄图像
- 指定selenium-standalone的chromedriver路径