Selenium 未创建Webdriver.io会话:无法创建新服务:GeckoDriverService

Selenium 未创建Webdriver.io会话:无法创建新服务:GeckoDriverService,selenium,firefox,selenium-webdriver,geckodriver,webdriver-io,Selenium,Firefox,Selenium Webdriver,Geckodriver,Webdriver Io,我正在运行Webdriver.io的初始项目设置,之前我可以运行测试,但现在出现了与geckodrivers或我不了解的功能相关的错误 我尝试查找geckodriver的一个问题,并查找geckodriver版本,因为我得到一些错误,如下所示: > webdriverio-test@1.0.0 test /home/apaliwal/Solution-Engine-new/new-solution-engine-test > wdio wdio.conf.js Execution

我正在运行Webdriver.io的初始项目设置,之前我可以运行测试,但现在出现了与geckodrivers或我不了解的功能相关的错误

我尝试查找geckodriver的一个问题,并查找geckodriver版本,因为我得到一些错误,如下所示:

> webdriverio-test@1.0.0 test /home/apaliwal/Solution-Engine-new/new-solution-engine-test
> wdio wdio.conf.js


Execution of 1 spec files started at 2019-05-28T08:04:11.842Z

[0-0] RUNNING in firefox - /test/test-specs/login.specs.js
[0-0] 2019-05-28T08:04:16.698Z ERROR webdriver: Request failed due to session not created: Unable to create new service: GeckoDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'localhost.localdomain', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.0.16-200.fc29.x86_64', java.version: '1.8.0_212'
Driver info: driver.version: unknown
    at getErrorFromResponseBody (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/webdriver/build/utils.js:349:10)
    at Request._callback (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/webdriver/build/request.js:121:64)
    at Request.self.callback (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/request/request.js:185:22)
    at Request.emit (events.js:189:13)
    at Request.EventEmitter.emit (domain.js:441:20)
    at Request.<anonymous> (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:189:13)
    at Request.EventEmitter.emit (domain.js:441:20)
    at IncomingMessage.<anonymous> (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:277:13)
[0-0] 2019-05-28T08:04:16.701Z ERROR @wdio/runner: session not created: Unable to create new service: GeckoDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'localhost.localdomain', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.0.16-200.fc29.x86_64', java.version: '1.8.0_212'
Driver info: driver.version: unknown
    at getErrorFromResponseBody (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/webdriver/build/utils.js:349:10)
    at Request._callback (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/webdriver/build/request.js:121:64)
    at Request.self.callback (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/request/request.js:185:22)
    at Request.emit (events.js:189:13)
    at Request.EventEmitter.emit (domain.js:441:20)
    at Request.<anonymous> (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:189:13)
    at Request.EventEmitter.emit (domain.js:441:20)
    at IncomingMessage.<anonymous> (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:277:13)
0-0 worker error { name: 'session not created',
  message:
   'Unable to create new service: GeckoDriverService\nBuild info: version: \'3.141.59\', revision: \'e82be7d358\', time: \'2018-11-14T08:25:53\'\nSystem info: host: \'localhost.localdomain\', ip: \'127.0.0.1\', os.name: \'Linux\', os.arch: \'amd64\', os.version: \'5.0.16-200.fc29.x86_64\', java.version: \'1.8.0_212\'\nDriver info: driver.version: unknown',
  stack:
   'session not created: Unable to create new service: GeckoDriverService\nBuild info: version: \'3.141.59\', revision: \'e82be7d358\', time: \'2018-11-14T08:25:53\'\nSystem info: host: \'localhost.localdomain\', ip: \'127.0.0.1\', os.name: \'Linux\', os.arch: \'amd64\', os.version: \'5.0.16-200.fc29.x86_64\', java.version: \'1.8.0_212\'\nDriver info: driver.version: unknown\n    at getErrorFromResponseBody (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/webdriver/build/utils.js:349:10)\n    at Request._callback (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/webdriver/build/request.js:121:64)\n    at Request.self.callback (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/request/request.js:185:22)\n    at Request.emit (events.js:189:13)\n    at Request.EventEmitter.emit (domain.js:441:20)\n    at Request.<anonymous> (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/request/request.js:1161:10)\n    at Request.emit (events.js:189:13)\n    at Request.EventEmitter.emit (domain.js:441:20)\n    at IncomingMessage.<anonymous> (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/request/request.js:1083:12)\n    at Object.onceWrapper (events.js:277:13)' }
[0-0] 2019-05-28T08:04:16.702Z ERROR @wdio/local-runner: Failed launching test session: TypeError: Cannot read property 'capabilities' of null
    at Runner.run (/home/apaliwal/Solution-Engine-new/new-solution-engine-test/node_modules/@wdio/runner/build/index.js:91:74)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[0-0] FAILED in firefox - /test/test-specs/login.specs.js

Spec Files:  0 passed, 1 failed, 1 total (100% completed) in 00:00:04 

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webdriverio-test@1.0.0 test: `wdio wdio.conf.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the webdriverio-test@1.0.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/apaliwal/.npm/_logs/2019-05-28T08_04_16_722Z-debug.log
壁虎河-v 1559030261896 geckodriver错误地址正在使用中(操作系统错误98)

wdio.conf.js:

exports.config = {
    //
    // ====================
    // Runner Configuration
    // ====================
    //
    // WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally or
    // on a remote machine).
    runner: 'local',
    //
    // ==================
    // Specify Test Files
    // ==================
    // Define which test specs should run. The pattern is relative to the directory
    // from which `wdio` was called. Notice that, if you are calling `wdio` from an
    // NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
    // directory is where your package.json resides, so `wdio` will be called from there.
    //
    specs: [
        './test/test-specs/**/*.specs.js'
    ],
    // Patterns to exclude.
    exclude: [
        // 'path/to/excluded/files'
    ],
    //
    // ============
    // Capabilities
    // ============
    // Define your capabilities here. WebdriverIO can run multiple capabilities at the same
    // time. Depending on the number of capabilities, WebdriverIO launches several test
    // sessions. Within your capabilities you can overwrite the spec and exclude options in
    // order to group specific specs to a specific capability.
    //
    // First, you can define how many instances should be started at the same time. Let's
    // say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
    // set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
    // files and you set maxInstances to 10, all spec files will get tested at the same time
    // and 30 processes will get spawned. The property handles how many capabilities
    // from the same test should run tests.
    //
    maxInstances: 10,
    maxInstancesPerCapability: 10,
    //
    // If you have trouble getting all important capabilities together, check out the
    // Sauce Labs platform configurator - a great tool to configure your capabilities:
    // https://docs.saucelabs.com/reference/platforms-configurator
    //
    capabilities: [{
        // maxInstances can get overwritten per capability. So if you have an in-house Selenium
        // grid with only 5 firefox instances available you can make sure that not more than
        // 5 instances get started at a time.
        //maxInstances: 5,
        //
        browserName: 'firefox',
        // If outputDir is provided WebdriverIO can capture driver session logs
        // it is possible to configure which logTypes to include/exclude.
        // excludeDriverLogs: ['*'], // pass '*' to exclude all driver session logs
        // excludeDriverLogs: ['bugreport', 'server'],
    }],
    //
    // ===================
    // Test Configurations
    // ===================
    // Define all options that are relevant for the WebdriverIO instance here
    //
    // Level of logging verbosity: trace | debug | info | warn | error | silent
    logLevel: 'error',
    //
    // Set specific log levels per logger
    // loggers:
    // - webdriver, webdriverio
    // - @wdio/applitools-service, @wdio/browserstack-service, @wdio/devtools-service, @wdio/sauce-service
    // - @wdio/mocha-framework, @wdio/jasmine-framework
    // - @wdio/local-runner, @wdio/lambda-runner
    // - @wdio/sumologic-reporter
    // - @wdio/cli, @wdio/config, @wdio/sync, @wdio/utils
    // Level of logging verbosity: trace | debug | info | warn | error | silent
    // logLevels: {
        // webdriver: 'info',
        // '@wdio/applitools-service': 'info'
    // },
    //
    // If you only want to run your tests until a specific amount of tests have failed use
    // bail (default is 0 - don't bail, run all tests).
    bail: 0,
    //
    // Set a base URL in order to shorten url command calls. If your `url` parameter starts
    // with `/`, the base url gets prepended, not including the path portion of your baseUrl.
    // If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
    // gets prepended directly.
    baseUrl: '<my base url>',
    //
    // Default timeout for all waitFor* commands.
    waitforTimeout: 10000,
    //
    // Default timeout in milliseconds for request
    // if Selenium Grid doesn't send response
    connectionRetryTimeout: 90000,
    //
    // Default request retries count
    connectionRetryCount: 3,
    //
    // Test runner services
    // Services take over a specific job you don't want to take care of. They enhance
    // your test setup with almost no effort. Unlike plugins, they don't add new
    // commands. Instead, they hook themselves up into the test process.
    services: ['selenium-standalone'],
    //
    // Framework you want to run your specs with.
    // The following are supported: Mocha, Jasmine, and Cucumber
    // see also: https://webdriver.io/docs/frameworks.html
    //
    // Make sure you have the wdio adapter package for the specific framework installed
    // before running any tests.
    framework: 'mocha',
    //
    // The number of times to retry the entire specfile when it fails as a whole
    // specFileRetries: 1,
    //
    // Test reporter for stdout.
    // The only one supported by default is 'dot'
    // see also: https://webdriver.io/docs/dot-reporter.html
    reporters: ['spec'],

    //
    // Options to be passed to Mocha.
    // See the full list at http://mochajs.org/
    mochaOpts: {
        ui: 'bdd',
        timeout: 100000
    },
    //
    // =====
    // Hooks
    // =====
    // WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
    // it and to build services around it. You can either apply a single function or an array of
    // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
    // resolved to continue.
    /**
     * Gets executed once before all workers get launched.
     * @param {Object} config wdio configuration object
     * @param {Array.<Object>} capabilities list of capabilities details
     */
    // onPrepare: function (config, capabilities) {
    // },
    /**
     * Gets executed just before initialising the webdriver session and test framework. It allows you
     * to manipulate configurations depending on the capability or spec.
     * @param {Object} config wdio configuration object
     * @param {Array.<Object>} capabilities list of capabilities details
     * @param {Array.<String>} specs List of spec file paths that are to be run
     */
    // beforeSession: function (config, capabilities, specs) {
    // },
    /**
     * Gets executed before test execution begins. At this point you can access to all global
     * variables like `browser`. It is the perfect place to define custom commands.
     * @param {Array.<Object>} capabilities list of capabilities details
     * @param {Array.<String>} specs List of spec file paths that are to be run
     */
    // before: function (capabilities, specs) {
    // },
    /**
     * Runs before a WebdriverIO command gets executed.
     * @param {String} commandName hook command name
     * @param {Array} args arguments that command would receive
     */
    // beforeCommand: function (commandName, args) {
    // },

    /**
     * Hook that gets executed before the suite starts
     * @param {Object} suite suite details
     */
    // beforeSuite: function (suite) {
    // },
    /**
     * Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
     * @param {Object} test test details
     */
    // beforeTest: function (test) {
    // },
    /**
     * Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
     * beforeEach in Mocha)
     */
    // beforeHook: function () {
    // },
    /**
     * Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling
     * afterEach in Mocha)
     */
    // afterHook: function () {
    // },
    /**
     * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
     * @param {Object} test test details
     */
    // afterTest: function (test) {
    // },
    /**
     * Hook that gets executed after the suite has ended
     * @param {Object} suite suite details
     */
    // afterSuite: function (suite) {
    // },

    /**
     * Runs after a WebdriverIO command gets executed
     * @param {String} commandName hook command name
     * @param {Array} args arguments that command would receive
     * @param {Number} result 0 - command success, 1 - command error
     * @param {Object} error error object if any
     */
    // afterCommand: function (commandName, args, result, error) {
    // },
    /**
     * Gets executed after all tests are done. You still have access to all global variables from
     * the test.
     * @param {Number} result 0 - test pass, 1 - test fail
     * @param {Array.<Object>} capabilities list of capabilities details
     * @param {Array.<String>} specs List of spec file paths that ran
     */
    // after: function (result, capabilities, specs) {
    // },
    /**
     * Gets executed right after terminating the webdriver session.
     * @param {Object} config wdio configuration object
     * @param {Array.<Object>} capabilities list of capabilities details
     * @param {Array.<String>} specs List of spec file paths that ran
     */
    // afterSession: function (config, capabilities, specs) {
    // },
    /**
     * Gets executed after all workers got shut down and the process is about to exit.
     * @param {Object} exitCode 0 - success, 1 - fail
     * @param {Object} config wdio configuration object
     * @param {Array.<Object>} capabilities list of capabilities details
     * @param {<Object>} results object containing test results
     */
    // onComplete: function(exitCode, config, capabilities, results) {
    // },
    /**
    * Gets executed when a refresh happens.
    * @param {String} oldSessionId session ID of the old session
    * @param {String} newSessionId session ID of the new session
    */
    //onReload: function(oldSessionId, newSessionId) {
    //}
}

exports.config={
//
// ====================
//转轮配置
// ====================
//
//WebdriverIO允许它在任意位置(例如本地或本地)运行测试
//在远程机器上)。
跑步者:“本地”,
//
// ==================
//指定测试文件
// ==================
//定义应该运行哪些测试规范。模式与目录相关
//从中调用'wdio'。注意,如果您是从
//NPM脚本(请参阅https://docs.npmjs.com/cli/run-script)那么现在的工作
//目录是package.json所在的位置,因此将从那里调用'wdio'。
//
规格:[
“./test/test specs/***.specs.js”
],
//要排除的模式。
排除:[
//“路径/到/排除/文件”
],
//
// ============
//能力
// ============
//在此处定义您的功能。WebdriverIO可以同时运行多个功能
//根据功能的数量,WebdriverIO会启动几个测试
//会话。在您的能力范围内,您可以覆盖规范并排除中的选项
//将特定规格分组到特定功能。
//
//首先,您可以定义应该同时启动多少个实例
//假设你有3种不同的功能(Chrome、Firefox和Safari),你有
//将maxInstances设置为1;wdio将生成3个进程。因此,如果您有10个规范
//如果将maxInstances设置为10,则所有等级库文件将同时进行测试
//将生成30个进程。该属性将处理多少功能
//从同一测试中,应运行测试。
//
最大实例:10,
maxInstancesPerCapability:10,
//
//如果您在整合所有重要功能时遇到困难,请查看
//Sauce Labs platform configurator—配置您的功能的绝佳工具:
// https://docs.saucelabs.com/reference/platforms-configurator
//
能力:[{
//每个功能都可以覆盖maxInstances
//网格中只有5个firefox实例可用,您可以确保
//一次启动5个实例。
//最大实例:5,
//
browserName:“firefox”,
//如果提供outputDir,WebDrivero可以捕获驱动程序会话日志
//可以配置要包括/排除的日志类型。
//excludeDriverLogs:['*',//传递'*'以排除所有驱动程序会话日志
//excludeDriverLogs:['bugreport','server'],
}],
//
// ===================
//测试配置
// ===================
//在此处定义与WebdriverIO实例相关的所有选项
//
//日志详细程度:跟踪|调试|信息|警告|错误|静默
日志级别:“错误”,
//
//设置每个记录器的特定日志级别
//伐木工人:
//-webdriver,webdriverio
//-@wdio/applitools服务、@wdio/browserstack服务、@wdio/devtools服务、@wdio/sauce服务
//-@wdio/mocha框架,@wdio/jasmine框架
//-@wdio/本地跑步者,@wdio/lambda跑步者
//-@wdio/消费新闻记者
//-@wdio/cli、@wdio/config、@wdio/sync、@wdio/utils
//日志详细程度:跟踪|调试|信息|警告|错误|静默
//日志级别:{
//webdriver:“信息”,
//“@wdio/applitools服务”:“信息”
// },
//
//如果您只想运行测试直到特定数量的测试失败,请使用
//保释(默认值为0-不保释,运行所有测试)。
保释金:0,
//
//设置基本URL以缩短URL命令调用。如果“URL”参数启动
//使用“/”,基本url将被加上前缀,而不包括基本url的路径部分。
//如果您的'url'参数在没有scheme或`/`(如'some/path`)的情况下启动,则基本url
//直接添加前缀。
baseUrl:“”,
//
//所有waitFor*命令的默认超时。
waitforTimeout:10000,
//
//请求的默认超时(毫秒)
//如果Selenium网格不发送响应
connectionRetryTimeout:90000,
//
//默认请求重试次数
connectionRetryCount:3,
//
//测试运行程序服务
//服务会接管你不想处理的特定工作。它们会增强
//您的测试设置几乎不费吹灰之力。与插件不同,它们不会添加新的
//相反,它们将自己连接到测试过程中。
服务:['selenium-standalone'],
//
//您希望运行规范的框架。
//支持以下内容:摩卡咖啡、茉莉花和黄瓜
//另见:https://webdriver.io/docs/frameworks.html
//
//确保已安装特定框架的wdio适配器包
//在运行任何测试之前。
框架:“摩卡”,
//
//当整个specfile失败时重试整个specfile的次数
//specFileRetries:1,
//
//stdout的测试报告程序。
//默认情况下仅支持“点”
//另见:https://webdriver.io/docs/dot-reporter.html
记者:['规格'],
//
//选项将传递给摩卡。
//请参阅http://mochajs.org/
莫查奥普茨:{
用户界面:“bdd”,
超时:100000
},
//
// =====
//钩子
/
ERROR @wdio/runner: session not created: Unable to create new service: GeckoDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'localhost.localdomain', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.0.16-200.fc29.x86_64', java.version: '1.8.0_212'
Driver info: driver.version: unknown