量角器"错误 - 无法启动的webdriver会话" [英] protractor "ERROR - Unable to start a WebDriver session"

查看:165
本文介绍了量角器"错误 - 无法启动的webdriver会话"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写在我的角度单页应用一些它的测试。
测试是在量角器。

I have some it tests on my single-page-app written in angular. the tests are in protractor.

他们以前的构建过程中运行,但现在,我感动所有的人都为分行得到的东西打破,当我跑我得到了测试:

they ran during the build before, but now that I moved all of them to a branch something got broken and when I run the tests I'm getting:

Running "protractor:normal" (protractor) task
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://172.31.9.226:23730/wd/hub
ERROR - Unable to start a WebDriver session.

c:\projects\blog-manager\node_modules\protractor\node_modules\selenium-    webdriver\lib\atoms\error.js:113
var template = new Error(this.message);
             ^
Warning: Protractor test(s) failed. Exit code: 1 Use --force to continue.

Aborted due to warnings.

Process finished with exit code 6

conf文件如下:

the conf file is as follows:

'use strict';

module.exports.config = {
    allScriptsTimeout: 60000,

    baseUrl: 'http://localhost:9000/',

    specs: [
            process.cwd() + '/test/spec/e2e/**/*.js'//,
           // process.cwd() + '/test/e2e/spec/**/*.js'
    ],

    framework: 'jasmine',

    capabilities: {
        browserName: 'chrome',
        "chromeOptions": {
            binary: "C:/Program Files      (x86)/Google/Chrome/Application/chrome.exe",
            args: [],
           extensions: [],
        }
    },

    onPrepare: function () {
        // Disable animations so e2e tests run more quickly
        var disableNgAnimate = function () {
            angular.module('disableNgAnimate', []).run(function ($animate) {
                $animate.enabled(false);
            });
        };

        browser.addMockModule('disableNgAnimate', disableNgAnimate);

        // Store the name of the browser that's currently being used.
        browser.getCapabilities().then(function (caps) {
            browser.params.browser = caps.get('browserName');
        });
    },

    jasmineNodeOpts: {
        defaultTimeoutInterval: 300000
    }
};

如何解决这个任何建议,将大大AP preciated。

any suggestions on how to solve this would be much appreciated.

谢谢!

推荐答案

据alecxe的回答是铬二元问题,它可以通过安装在同一个地方铬为 chromedriver 解决希望成为或指定的二进制设置的可执行文件的路径。

According to alecxe's answer it's chrome binary issue which can be solved by installing chrome in same place as chromedriver expects to be or specifying the executable path to the binary settings.

capabilities: {
    "browserName": "chrome",
    "chromeOptions": {
        binary: "D:/Program Files/Chrome/chrome.exe",
        args: [],
        extensions: [],
    }
},

见他的回答<一个href=\"http://stackoverflow.com/questions/27493715/protractor-gives-unable-to-start-a-webdriver-session-error\">here

即使您设置可执行文件的路径正确,似乎有点过我的二进制文件:C:/ Program Files文件(x86)的/Google/Chrome/Application/chrome.exe

Even though you are setting the executable path correctly it seems little off to me binary: "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",

这是正确的?

另外,我会尝试

这篇关于量角器&QUOT;错误 - 无法启动的webdriver会话&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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