如何在 Protractor 中配置 firefox 二进制位置? [英] How can I configure the firefox binary location in Protractor?

查看:20
本文介绍了如何在 Protractor 中配置 firefox 二进制位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Chrome 成功运行 Protractor 测试,使用我的 Protractor 配置中的以下部分指定我的 chrome 二进制文件的路径:

I am successfully running Protractor tests with Chrome, specifying the path to my chrome binary using the following section in my Protractor configuration:

capabilities: {
// You can use other browsers
// like firefox, phantoms, safari, IE
'browserName': 'chrome',
"chromeOptions": {
  binary: 'C:/BuildSoftware/Chrome/Application/chrome.exe',
}

这行得通.

我的 Firefox 也安装在非标准位置.

My Firefox is also installed in a non-standard location.

是否有等效的方法在量角器配置中为 Firefox 指定二进制文件?

Is there an equivalent way to specify the binary for Firefox in the protractor config?

推荐答案

更新: 请参阅下面的更新答案:https://stackoverflow.com/a/28313583/800699

UPDATED: See newer answer below: https://stackoverflow.com/a/28313583/800699

看来您必须使用 Firefox 驱动程序的自定义参数自己启动 Selenium 服务器.请参阅 量角器测试未在 Firefox 上开始

It seems you have to start the Selenium Server by yourself with custom arguments for firefox driver. See Protractor test is not starting on Firefox

firefox 驱动程序的更多选项(包括自定义 firefox 二进制位置)可以在这里找到:https://code.google.com/p/selenium/wiki/FirefoxDriver

More options for firefox driver (including custom firefox binary location) can be found here: https://code.google.com/p/selenium/wiki/FirefoxDriver

P/S:浏览 Firefox 驱动程序源会发现更多亮点:https://code.google.com/p/selenium/source/browse/javascript/node/selenium-webdriver/firefox/index.js

P/S: Browsing the firefox driver source reveals more light: https://code.google.com/p/selenium/source/browse/javascript/node/selenium-webdriver/firefox/index.js

您可以尝试添加:

"browserName": "firefox",
"firefox_binary": "path/to/custom/firefox",
"binary_": "path/to/custom/firefox"

这篇关于如何在 Protractor 中配置 firefox 二进制位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆