0

我在 linux ubuntu 上运行量角器测试有问题,浏览器无法打开(谷歌浏览器)运行测试我使用命令
量角器 ./config.js

我有错误

[22:04:01] I/launcher - Running 1 instances of WebDriver
[22:04:01] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[22:05:01] E/launcher - unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Linux 4.13.0-38-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.06 seconds
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:15.31Z'
System info: host: 'maciek', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.13.0-38-generic', java.version: '1.8.0_161'
Driver info: driver.version: unknown
[22:05:01] E/launcher - WebDriverError: unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Linux 4.13.0-38-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.06 seconds
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:15.31Z'
System info: host: 'maciek', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.13.0-38-generic', java.version: '1.8.0_161'
Driver info: driver.version: unknown
    at WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
    at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546:15)
    at parseHttpResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
    at doSend.then.response (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:441:30)
    at process._tickCallback (internal/process/next_tick.js:109:7)
From: Task: WebDriver.createSession()
    at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
    at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:761:15)
    at createDriver (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:170:33)
    at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:626:16)
    at Hosted.getNewDriver (/usr/local/lib/node_modules/protractor/built/driverProviders/driverProvider.js:53:33)
    at Runner.createBrowser (/usr/local/lib/node_modules/protractor/built/runner.js:195:43)
    at q.then.then (/usr/local/lib/node_modules/protractor/built/runner.js:339:29)
    at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:796:13)
[22:05:01] E/launcher - Process exited with error code 199

我使用 webdriver-manager: consol log

[18:58:53] I/start - java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.chrome.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.37 -Dwebdriver.gecko.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.20.1 -jar /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.11.0.jar -port 4444
[18:58:53] I/start - seleniumProcess.pid: 17729
18:58:54.153 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.11.0', revision: 'e59cfb3'
18:58:54.154 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4444
2018-04-09 18:58:54.223:INFO::main: Logging initialized @250ms to org.seleniumhq.jetty9.util.log.StdErrLog
18:58:54.339 INFO [SeleniumServer.boot] - Welcome to Selenium for Workgroups....
18:58:54.340 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
18:58:59.229 INFO [ActiveSessionFactory.apply] - Capabilities are: Capabilities {browserName: chrome, chromeOptions: {}, count: 1}
18:58:59.230 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7) on port 16779
Only local connections are allowed

命令 webdriver-manager status

webdriver-manager: using global installed version 12.0.6
[22:08:53] I/status - selenium standalone version available: 3.11.0 [last]
[22:08:53] I/status - chromedriver versions available: 2.36, 2.37 [last]
[22:08:53] I/status - geckodriver version available: v0.20.1 [last]
[22:08:53] I/status - android-sdk is not present
[22:08:53] I/status - appium is not present

和 java --version

java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

谷歌浏览器版本:版本 65.0.3325.181(64 位)

我换了电脑,以前没有问题(在我使用 linux mint 之前,现在我有 linux ubuntu)。

它是从 docker 开始的 Angular 应用程序

我的 config.js 看起来

exports.config = {
  framework: 'jasmine',
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['e2e/myTest'],
  capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {
     args: ['--no-sandbox']
   }
  },
  chromeOnly: true,
};

在控制台 webdriver-manager 中的任何错误

知道我能做什么吗?

4

2 回答 2

1

我使用命令启动 webdriver-manager 时解决了问题

webdriver-manager start --detach 

我没有任何错误

于 2018-04-09T17:19:59.587 回答
0

您有两个安装了不同版本的 chrome 驱动程序。也许你可以尝试卸载旧的。此外,您无需提供 chromeOnly 标志。

确保没有指向不同文件夹的符号链接。

于 2018-04-09T14:37:12.510 回答