首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >量角器找不到web管理器

量角器找不到web管理器
EN

Stack Overflow用户
提问于 2018-02-05 12:55:41
回答 2查看 764关注 0票数 0

我有量角器安装在项目文件夹+网络管理器(安装方式相同)。

网络管理器已经启动:

代码语言:javascript
复制
$npm-run webdriver-manager status

webdriver-manager: using global installed version 12.0.6
- selenium standalone version available: 3.8.1 [last]
- chromedriver version available: 2.35 [last]
- geckodriver version available: v0.19.1 [last]
- IEDriverServer is not present

但是,当我运行量角器时

代码语言:javascript
复制
$ npm-run protractor  conf.js

[15:22:12] I/launcher - Running 1 instances of WebDriver
[15:22:12] E/local - Error code: 135
[15:22:12] E/local - Error message: No update-config.json found. Run 'webdriver-manager update' to download binaries.
[15:22:12] E/local - Error: No update-config.json found. Run 'webdriver-manager update' to download binaries.

这是我的量角器的conf.js

代码语言:javascript
复制
exports.config = {

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

  },

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

};

如何修复配置/运行protrator?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-02-07 10:16:34

最后,用gulp找到了一个解决方案。下面的配置允许运行网站管理器-更新,网络管理器-启动和推进由一个.

gulp.js

代码语言:javascript
复制
var gulp = require('gulp'), 
    shell = require('gulp-shell'),
    connect = require('gulp-connect'); // Webserver
    protractor = require('gulp-protractor').protractor,
    webdriver_standalone = require('gulp-protractor').webdriver_standalone,
    webdriver_update = require('gulp-protractor').webdriver_update;


gulp.task('webdriver_update', webdriver_update);
gulp.task('webdriver_standalone', webdriver_standalone);

gulp.task('e2e', ['webdriver_update'], function() {
  gulp.src(["tests/protractor/*.js"])
    .pipe(protractor({
        configFile: "protractor.conf.js",
        args: [
            //'--baseUrl', 'http://127.0.0.1:8000',
           // '--suite', 'login',
           // '--params.environment', 'test'
        ]
    }))
    .on('error', function(e) { throw e })
});

protractor.conf.js

代码语言:javascript
复制
exports.config = {

  seleniumServerJar: './node_modules/webdriver-manager/selenium/selenium-server-standalone-3.9.0.jar',

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

  },

};

(对selenium服务器使用URL是重要的)

发射命令:

代码语言:javascript
复制
gulp e2e
票数 0
EN

Stack Overflow用户

发布于 2018-02-05 13:16:47

如果从未执行npm-run webdriver-manager update,则需要运行WebDriverBinaryandSeleni-Standalon-server.jar,否则命令将更新已有的内容。

然后,在node_modules\protractor\node_modules\webdriver-manager\selenium中找到node_modules\protractor\node_modules\webdriver-manager\selenium

其内容应如下:

代码语言:javascript
复制
{
    "chrome": {
        "last": "xxx\\node_modules\\protractor\\node_modules\\webdriver-manager\\selenium\\chromedriver_2.35.exe",
        "all": ["xxx\\node_modules\\protractor\\node_modules\\webdriver-manager\\selenium\\chromedriver_2.35.exe"]
    },
    "standalone": {
        "last": "xxx\\node_modules\\protractor\\node_modules\\webdriver-manager\\selenium\\selenium-server-standalone-3.9.0.jar",
        "all": ["xxx\\node_modules\\protractor\\node_modules\\webdriver-manager\\selenium\\selenium-server-standalone-3.9.0.jar"]
    },
    "gecko": {
        "last": "xxx\\node_modules\\protractor\\node_modules\\webdriver-manager\\selenium\\geckodriver-v0.19.1.exe",
        "all": ["xxx\\node_modules\\protractor\\node_modules\\webdriver-manager\\selenium\\geckodriver-v0.19.1.exe"]
    }
}

然后执行node_modules\.bin\webdriver-manager start来查看成功还是失败。

FYI,您需要安装JDK 8来启动webdriver。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48623114

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档