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

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

问题描述

我正在尝试在 IE11 上运行我的 jasmine E2E 测试,但没有任何运气.我在 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 已添加到我的路径中.我已经完成了所有必需的配置:https://code.google.com/p/selenium/wiki/InternetExplorerDriver#Required_Configuration

IEDriverServer.exe is added to my path. I've did all the requred config: https://code.google.com/p/selenium/wiki/InternetExplorerDriver#Required_Configuration

有什么想法吗?

推荐答案

根据直接连接到浏览器驱动程序 directConnect 设置仅适用于 Firefox 和 Chrome:

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

directConnect: true - 您的测试脚本直接与 Chrome 通信驱动程序或 Firefox 驱动程序,绕过任何 Selenium 服务器.如果这是true,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:

You need to remove/comment out directConnect:

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

<小时>

仅供参考,您实际上可以将 capabilitiesmultiCapabilities 一起定义,但在这种情况下 protractor 会简单地忽略 capabilities 并使用 multiCapabilities (文档).


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天全站免登陆