简体   繁体   中英

Unable to start protractor with IE

I'm running e2e test using grunt-protractor-runner on Windows 7 VM My node version is 0.10.25 My protractor version is 2.5.1

I think the problem is with protractor configuration.

When I run I get this:

 Using the selenium server at http://127.0.0.1:4444/wd/hub
[launcher] Running 1 instances of WebDriver
ERROR - Unable to start a WebDriver session.

/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113
  var template = new Error(this.message);
                 ^
UnknownError: Unable to find executable for product Opera Desktop
    at new bot.Error (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113:18)
    at Object.bot.response.checkResponse (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/response.js:106:9)
    at /home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:152:24
    at /home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
    at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1654:20)
    at notify (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:465:12)
    at notifyAll (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:442:7)
    at resolve (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:420:7)
    at fulfill (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:535:5)
    at /home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
==== async task ====
WebDriver.createSession()
    at Function.webdriver.WebDriver.acquireSession_ (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:149:22)
    at Function.webdriver.WebDriver.createSession (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:123:30)
    at Builder.build (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/builder.js:294:22)
    at DriverProvider.getNewDriver (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7)
    at Runner.createBrowser (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/lib/runner.js:180:37)
    at /home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/lib/runner.js:257:21
    at _fulfilled (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/q/q.js:797:54)
    at self.promiseDispatch.done (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/q/q.js:826:30)
    at Promise.promise.promiseDispatch (/home/luca/my-project/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/q/q.js:759:13)
[launcher] Process exited with error code 1
>> 
Fatal error: protractor exited with code: 1

Here is my configuration file:

'use strict';
/* globals jasmine */

var path = require('path');
var FsCleaner = require('./lib/fs-cleaner');

exports.config = {

    seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
    /*    seleniumAddress: 'http://10.0.2.15:4444/wd/hub',
     */
    specs: require('./specList.js'),
    params: {
        screenshotsBasePath: path.resolve(__dirname, './screenshots')
    },
    capabilities: {
        'browserName': 'internet explorer',
        'platform': 'ANY',
        'version': '9',

        // 'ie.ensureCleanSession':true,
        // 'nativeEvents':false
    },

    allScriptsTimeout: 300 * 1000,
    getPageTimeout: 300 * 1000,
    jasmineNodeOpts: {
        defaultTimeoutInterval: 300 * 1000
    },
    onPrepare: function() {
        var SpecReporter = require('jasmine-spec-reporter');
        // add jasmine spec reporter
        jasmine.getEnv().addReporter(new SpecReporter({
            // displayStacktrace: true
            displayStacktrace: 'none',
        }));
        FsCleaner.cleanScreenshotsFolder();
        FsCleaner.cleanDownloadFolder();
    }

};

Firstly, try to download IE driver from here http://www.seleniumhq.org/download/ Try to use 32bit and 64bit version too.

In my opinion, testing in IE is very very confusing. If you want to test in win7 and ie, you have to modify regs. To get more information please check this link: https://code.google.com/p/selenium/issues/detail?id=8302#c18

If you succeed in set up the IE and protractor. It will may occur some problematic issues. For example: Slow typing. For more information please check this: https://code.google.com/p/selenium/issues/detail?id=5116

However, if you use a prior version of an IE driver it will may solve the slow typing problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM