量角器+ Firefox +泊坞窗:无效参数:无法杀死已退出的进程

时间:2018-09-20 07:30:20

标签: firefox protractor geckodriver gecko

我曾经工作,但是一个星期以来,在docker中运行时,我的角度E2E测试无法启动。如果我直接运行它们,仍然可以。

protractor.conf.js

exports.config = {
  capabilities: {
    browserName: 'firefox',
    'moz:firefoxOptions': {
      args: [
        '--headless'
      ]
    }
  }
  directConnect: true,
  baseUrl: 'http://localhost:4200',
  framework: 'jasmine',
  ...
}

如果我启动网络驱动程序:webdriver-manager start

然后量角器:protractor protractor.conf.js

输出:

I/launcher - Running 1 instances of WebDriver
I/direct - Using FirefoxDriver directly...
E/launcher - invalid argument: can't kill an exited process
E/launcher - WebDriverError: invalid argument: can't kill an exited process
    at Object.throwDecodedError (/tmp/e2e-test/node_modules/selenium-webdriver/lib/error.js:514:15)
    at parseHttpResponse (/tmp/e2e-test/node_modules/selenium-webdriver/lib/http.js:519:13)
    at doSend.then.response (/tmp/e2e-test/node_modules/selenium-webdriver/lib/http.js:441:30)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
From: Task: WebDriver.createSession()
    at Function.createSession (/tmp/e2e-test/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
    at Function.createSession (/tmp/e2e-test/node_modules/selenium-webdriver/firefox/index.js:521:41)
    at Direct.getNewDriver (/tmp/e2e-test/node_modules/protractor/built/driverProviders/direct.js:105:33)
    at Runner.createBrowser (/tmp/e2e-test/node_modules/protractor/built/runner.js:195:43)
    at q.then.then (/tmp/e2e-test/node_modules/protractor/built/runner.js:339:29)
    at _fulfilled (/tmp/e2e-test/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/tmp/e2e-test/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/tmp/e2e-test/node_modules/q/q.js:796:13)
    at /tmp/e2e-test/node_modules/q/q.js:556:49
    at runSingle (/tmp/e2e-test/node_modules/q/q.js:137:13)
E/launcher - Process exited with error code 199

我已经尝试使用Firefox 62.0和60.0.2进行了更改。

2 个答案:

答案 0 :(得分:2)

在跟踪每个软件的新发行版之后,我终于发现new v0.22.0 release收到了gecko-driver,这似乎破坏了量角器/硒。{p> 3

目前,我将强制使用veck的geckodriver v0.21.0:

webdriver-manager update  --versions.gecko=v0.21.0

答案 1 :(得分:0)

对我来说,running Firefox in headless mode解决了这个问题。