无法在Internet Explorer 11运行量角器 [英] Cannot run protractor on Internet explorer 11

查看:263
本文介绍了无法在Internet Explorer 11运行量角器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行IE11,但没有运气或任何我的茉莉花端到端测试。
我在Windows 8.1。
我的配置:

I'm trying to run my jasmine E2E tests on IE11 but with no luck or whatsoever. I'm on Windows 8.1. My config:

exports.config = {
    directConnect: true,

    // Capabilities to be passed to the webdriver instance.
    capabilities: {
        'browserName': 'chrome'
    },

    // run in multiple browsers
    multiCapabilities:[
     //    {
     //        'browserName': 'chrome'
     //    },
        // {
     //        'browserName': 'firefox'
     //    },       
        {
           'browserName': 'internet explorer',
        }
    ],

    // Spec patterns are relative to the current working directly when
    // protractor is called.
    specs: ['./**/*js'],

    // Options to be passed to Jasmine-node.
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000
    },

    onPrepare: function () {
        // The require statement must be down here, since jasmine-reporters@1.0
        // needs jasmine to be in the global and protractor does not guarantee
        // this until inside the onPrepare function.
        require('jasmine-reporters');
        jasmine.getEnv().addReporter(
            new jasmine.JUnitXmlReporter('xmloutput', true, true)
        );
    }
};

Chrome和Firefox的工作就像一个魅力,但IE浏览器给了我这样的:

Chrome and Firefox work like a charm but IE gives me this:

Error: browserName (internet explorer) is not supported with directConnect.

IEDriverServer.exe添加到我的道路。我已经做了所有的requred配置:的https://$c$c.google.com/p/selenium/wiki/InternetExplorerDriver#Required_Configuration

任何想法?

推荐答案

据<一个href=\"https://github.com/angular/protractor/blob/master/docs/server-setup.md#connecting-directly-to-browser-drivers\"相对=nofollow>直接连接到浏览器的驱动程序 的DirectConnect 设置将为Firefox和Chrome只工作:

According to Connecting Directly to Browser Drivers directConnect setting would work for Firefox and Chrome only:

的DirectConnect:真正的 - 你的测试脚本直接通信的Chrome
  驱动程序或Firefox驱动程序,绕过任何Selenium服务器。如果这是
  真的,因为seleniumAddress和seleniumServerJar设置将
  忽略。 如果您尝试使用比Chrome或Firefox等浏览器
  错误会抛出

directConnect: true - Your test script communicates directly Chrome Driver or Firefox Driver, bypassing any Selenium Server. If this is true, settings for seleniumAddress and seleniumServerJar will be ignored. If you attempt to use a browser other than Chrome or Firefox an error will be thrown.

您需要删除/注释掉的DirectConnect

exports.config = {
    multiCapabilities:[
        {
           'browserName': 'internet explorer'
        }
    ],
    ...
}


仅供参考,实际上你可以离开 功能与 multiCapabilities 旁边的定义,但在这种情况下,量角器将简单地忽略功能,并使用 multiCapabilities (<一个href=\"https://github.com/angular/protractor/blob/master/docs/browser-setup.md#testing-against-multiple-browsers\"相对=nofollow>文档)。


FYI, you can actually leave capabilities defined alongside with multiCapabilities, but in this case protractor would simply ignore capabilities and use multiCapabilities (docs).

这篇关于无法在Internet Explorer 11运行量角器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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