【问题标题】:Unable to install gecko driver to run protractor test scripts in fire fox browser无法安装壁虎驱动程序以在 Firefox 浏览器中运行量角器测试脚本
【发布时间】:2018-03-28 19:14:20
【问题描述】:
我是“量角器工具”的新手,我可以在“Chrome”浏览器中运行我的测试脚本。现在我想在“Firefox”中运行我的测试脚本,因为我需要安装“gecko 驱动程序”。
谁能告诉我如何安装“gecko driver”在“firefox”浏览器中运行测试脚本?
我正在使用
节点 -- v6.11.3
NPM -- 3.10.10
量角器 -- 5.1.2
【问题讨论】:
标签:
node.js
typescript
npm
jasmine
protractor
【解决方案2】:
它非常简单。只需执行以下操作:
- 使用命令 - “webdriver-manager status” 检查您的机器中是否已经安装了 Gecko 驱动程序驱动程序。这将在命令提示符下显示已安装的内容,如 Selenium Server、IE、Chrome 和 Gecko 驱动程序以及版本详细信息
如果您在上述列表中没有找到 Gecko。运行以下命令安装 Gecko 驱动程序 - webdriver-manager update
安装 Gecko 驱动程序后,更改 conf.js 文件中的 browserName:"firefox" 并运行您的测试脚本。
【解决方案3】:
如果 webdriver-manger 更新不工作,然后手动下载驱动程序:https://github.com/mozilla/geckodriver/releases
现在转到:
C:\Users\somepath\node_modules\protractor\node_modules\webdriver-manager\selenium
and below property to update-config.json
"gecko": {
"last": "C:\\pathtogeko\\geckodriver.exe"
}
如果该内容不存在,则使用该内容创建一个新文件:
{
"gecko": {
"last": "C:\\pathtogeko\\geckodriver.exe"
}
}