尝试启动Chrome浏览器时,DevToolsActivePort文件不存在

时间:2018-07-06 13:42:53

标签: node.js selenium selenium-webdriver protractor selenium-chromedriver

我正在尝试使用量角器和硒(正在该项目的另一台计算机上运行)运行测试,为什么浏览器无法启动?有什么建议么 ?我做了webdriver-manager更新并全局安装了量角器。

protractor.conf.js

exports.config = {
    framework: 'jasmine',
    seleniumAddress: 'http://localhost:4444/wd/hub',
    specs: ['./e2e/**/*.spec.js'],
    capabilities: {
        browserName: 'chrome'
    }
};

webdriver-manager启动

 [15:18:20] I/start - java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.chrome.driver=/usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.40 -Dwebdriver.gecko.driver=/usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.21.0 -jar /usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.13.0.jar -port 4444
    [15:18:20] I/start - seleniumProcess.pid: 16130
    15:18:20.810 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.13.0', revision: '2f0d292'
    15:18:20.812 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4444
    2018-07-06 15:18:20.926:INFO::main: Logging initialized @346ms to org.seleniumhq.jetty9.util.log.StdErrLog
    15:18:21.052 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
    15:18:33.261 INFO [ActiveSessionFactory.apply] - Capabilities are: {
      "browserName": "chrome",
      "count": 1
    }
    15:18:33.262 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
    Starting ChromeDriver 2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7) on port 28450
    Only local connections are allowed.

npm运行量角器

Driver info: driver.version: unknown
[15:19:33] E/launcher - WebDriverError: unknown error: DevToolsActivePort file doesn't exist
  (Driver info: chromedriver=2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7),platform=Linux 4.15.0-24-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.07 seconds
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:32:19.891Z'
System info: host: 'piotr-GE60-2PC', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-24-generic', java.version: '10.0.1'
Driver info: driver.version: unknown
    at Object.checkLegacyResponse (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546:15)
    at parseHttpResponse (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
    at doSend.then.response (/usr/lib/node_modules/protractor/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 (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
    at Function.createSession (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:761:15)
    at createDriver (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:170:33)
    at Builder.build (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:626:16)
    at Hosted.getNewDriver (/usr/lib/node_modules/protractor/built/driverProviders/driverProvider.js:53:33)
    at Runner.createBrowser (/usr/lib/node_modules/protractor/built/runner.js:195:43)
    at q.then.then (/usr/lib/node_modules/protractor/built/runner.js:339:29)
    at _fulfilled (/usr/lib/node_modules/protractor/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/usr/lib/node_modules/protractor/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/usr/lib/node_modules/protractor/node_modules/q/q.js:796:13)
[15:19:33] E/launcher - Process exited with error code 199

0 个答案:

没有答案