【问题标题】:launching browsers from the commandline从命令行启动浏览器
【发布时间】:2017-11-13 19:50:37
【问题描述】:

对量角器很陌生,但这个让我很难过。
在 Windows 10 上运行 Angular 1.5.0。

我希望能够从命令行覆盖在我的 config.js 文件中指定的浏览器。在挖掘之后,我发现使用以下是如何做到的: 量角器 --capabilities.browserName='x' config.js

但是,如果我尝试使用 firefox,则会启动 chrome,如果我尝试启动 IE(使用 --capabilities.browserName='internet explorer',则会收到关于只有一个配置文件的错误。

我还尝试将垃圾作为浏览器名称并启动 chrome - 所以看起来 chrome 是默认设置,从使用 selenium 我必须指定 IE 驱动程序服务器(实际上是 chrome 驱动程序)的路径 - 是量角器一样吗?

以下是配置文件供参考 - 它非常基本(就像我说的我还在学习量角器)

var HtmlReporter = require('protractor-beautiful-reporter');

exports.config = { 框架:'茉莉花',

capabilities: {
    'browserName': 'chrome'
},
seleniumAddress: 'http://localhost:4444/wd/hub',


specs: ['LA1-310-Q4.js'],

baseUrl: 'http://localhost:4200',

onPrepare: function() {
    jasmine.getEnv().addReporter(new HtmlReporter({
        baseDirectory: 'reports2/'
    }).getJasmine2Reporter());
}

};

【问题讨论】:

    标签: protractor


    【解决方案1】:

    我已经设法让它工作了。看来我没有意识到引号的重要性。

    所以使用: protractor --capabilities.browserName='firefox' config.js 启动 chrome,但是将其更改为: protractor --capabilities.browserName=firefox config.js 推出火狐。对于 Internet Explorer,我必须使用双引号。现已排序。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-29
      • 2018-02-07
      • 1970-01-01
      • 1970-01-01
      • 2011-12-01
      • 1970-01-01
      • 2020-08-17
      • 1970-01-01
      相关资源
      最近更新 更多