当前位置: 首页 > 知识库问答 >
问题:

ChromeDriver在Jenkins Selenium作业上不断崩溃:WebDriverError:Chrome启动失败:崩溃”

宦翔飞
2023-03-14

我正在尝试使用量角器在Jenkins上运行一些自动化测试,量角器使用硒和铬驱动。

我还设置了xvfb,这样我们就可以无头地运行这些测试。我已经安装了xvfb jenkins插件,它工作正常。

我遇到的问题是,当我开始测试时,chrome不断崩溃。我得到这个错误:

E/launcher - WebDriverError: unknown error: Chrome failed to start: crashed
...
E/launcher - Process exited with error code 199

以下是关于系统设置的信息:

    • 位置:/usr/bin/google-chrome
    • 版本:Chromium 52.0。2743.0
    • 位置:{project_home}/src/js/node_modules/webdrive-Manager/selenium/chromedriver_2.24
    • 版本:ChromeDriver2.24.417424
    • 位置:{project_home}/src/js/node_modules/webdriver manager/selenium/selenium-server-standalone-2.53。1.jar
    • 位置:{project_home}/src/js/node_modules/量角器
    • 版本:4.0.9
    • 位置:{project\u home}/src/js/node\u modules/webdriver manager
    • 版本:1.6。十七,
    • 版本:未知
    • 版本:6.7
    • 版本:java-8-openjdk-amd64

    以下是Jenkins的控制台输出:

    ...
    21:58:07.380 INFO - Launching a standalone Selenium Server
    21:58:07.407 INFO - Java: Oracle Corporation 25.111-b14
    21:58:07.407 INFO - OS: Linux 4.4.0-47-generic amd64
    21:58:07.418 INFO - v2.53.1, with Core v2.53.1. Built from revision a36b8b1
    21:58:07.473 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
    registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX
    21:58:07.474 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
    registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX
    21:58:07.474 INFO - Driver class not found: com.opera.core.systems.OperaDriver
    21:58:07.474 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
    21:58:07.475 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
    registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform LINUX
    21:58:07.475 INFO - Driver class not found: org.openqa.selenium.htmlunit.HtmlUnitDriver
    21:58:07.475 INFO - Driver provider org.openqa.selenium.htmlunit.HtmlUnitDriver is not registered
    21:58:07.527 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
    21:58:07.527 INFO - Selenium Server is up and running
    Current webdriver status: [21:58:08] I/status - selenium standalone version available: 2.53.1 [default]
    [21:58:08] I/status - chromedriver versions available: 2.22, 2.24 [default]
    [21:58:08] I/status - geckodriver version available: v0.9.0 [default]
    [21:58:08] I/status - android-sdk is not present
    [21:58:08] I/status - appium is not present
    **** STARTING GUI TESTS ****
    
    
    Running ./node_modules/protractor/bin/protractor conf-server.js
    [21:58:08] I/local - Starting selenium standalone server...
    [21:58:08] I/launcher - Running 1 instances of WebDriver
    [21:58:09] I/local - Selenium standalone server started at http://10.0.0.82:33509/wd/hub
    [21:59:09] E/launcher - unknown error: Chrome failed to start: crashed
      (Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 4.4.0-47-generic x86_64) (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 60.17 seconds
    Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
    System info: host: 'ip-10-0-0-82', ip: '10.0.0.82', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-47-generic', java.version: '1.8.0_111'
    Driver info: org.openqa.selenium.chrome.ChromeDriver
    [21:59:09] E/launcher - WebDriverError: unknown error: Chrome failed to start: crashed
      (Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 4.4.0-47-generic x86_64) (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 60.17 seconds
    Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
    System info: host: 'ip-10-0-0-82', ip: '10.0.0.82', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-47-generic', java.version: '1.8.0_111'
    Driver info: org.openqa.selenium.chrome.ChromeDriver
        at WebDriverError ({project_home}/src/js/node_modules/selenium-webdriver/lib/error.js:27:5)
        at Object.checkLegacyResponse ({project_home}/src/js/node_modules/selenium-webdriver/lib/error.js:639:15)
        at parseHttpResponse ({project_home}/src/js/node_modules/selenium-webdriver/http/index.js:538:13)
        at client_.send.then.response ({project_home}/src/js/node_modules/selenium-webdriver/http/index.js:472:11)
        at ManagedPromise.invokeCallback_ ({project_home}/src/js/node_modules/selenium-webdriver/lib/promise.js:1379:14)
        at TaskQueue.execute_ ({project_home}/src/js/node_modules/selenium-webdriver/lib/promise.js:2913:14)
        at TaskQueue.executeNext_ ({project_home}/src/js/node_modules/selenium-webdriver/lib/promise.js:2896:21)
        at asyncRun ({project_home}/src/js/node_modules/selenium-webdriver/lib/promise.js:2820:25)
        at {project_home}/src/js/node_modules/selenium-webdriver/lib/promise.js:639:7
        at process._tickCallback (internal/process/next_tick.js:103:7)
    From: Task: WebDriver.createSession()
        at Function.createSession ({project_home}/src/js/node_modules/selenium-webdriver/lib/webdriver.js:329:24)
        at Builder.build ({project_home}/src/js/node_modules/selenium-webdriver/builder.js:458:24)
        at Local.DriverProvider.getNewDriver ({project_home}/src/js/node_modules/protractor/built/driverProviders/driverProvider.js:37:33)
        at Runner.createBrowser ({project_home}/src/js/node_modules/protractor/built/runner.js:198:43)
        at {project_home}/src/js/node_modules/protractor/built/runner.js:277:30
        at _fulfilled ({project_home}/src/js/node_modules/q/q.js:834:54)
        at self.promiseDispatch.done ({project_home}/src/js/node_modules/q/q.js:863:30)
        at Promise.promise.promiseDispatch ({project_home}/src/js/node_modules/q/q.js:796:13)
        at {project_home}/src/js/node_modules/q/q.js:604:44
        at runSingle ({project_home}/src/js/node_modules/q/q.js:137:13)
    [21:59:09] E/launcher - Process exited with error code 199
    
    exports.config = {
      seleniumServerJar: './node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar',
      chromeDriver: './node_modules/webdriver-manager/selenium/chromedriver_2.24',
    
      capabilities: {
        'browserName': 'chrome',
        'chromeOptions': {
          binary: '/usr/bin/google-chrome',
          args: ['--enable-logging','--v=1'],
          extensions: []
        }
      },
    
      framework: 'custom',
      frameworkPath: require.resolve('./node_modules/protractor-cucumber-framework'),
      specs: [
          '../../features/gui/active/*.feature'
      ],
    
      onPrepare: function ()
      {
        require('babel-register')({ presets : ['es2015'] })
      }
    };
    

    • 铬参考:https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start

共有3个答案

从渊
2023-03-14

我和你有同样的问题,最后我把我的参数改成了下面的

args: [ "--无头的","--no-沙盒","--disable-dev-shm使用"]

公孙芷阳
2023-03-14

您可以按照以下步骤操作:
-在jenkins设置中添加一个全局属性

键:显示

值:0:0-在服务器上,在后台启动Xvfb:

xvfb: 0-ac-屏幕0 1024x768x24

参考链接:未知错误:Chrome启动失败:异常退出(驱动信息:chromeDrive=2.9

赫连明诚
2023-03-14

请尝试更新量角器到最新的4.0.11和铬驱动程序到2.25,因为在2.24版本中有很多问题已经修复。

尝试一次,让我们知道。

 类似资料:
  • 问题内容: 我正在尝试使用使用 硒* 和 chromedriver的 量角器 在 Jenkins 上运行一些自动化测试。 *** 我还设置了 xvfb, 以便我们可以 无头 运行这些测试。我已经安装了 xvfb jenkins插件 ,并且可以正常工作。 我遇到的问题是,当我开始测试时,chrome不断崩溃。我收到此错误: 建立 这是我有关系统设置的信息: Chrome 位置: 版本:Chromiu

  • 我正在使用C#Selenium进行自动测试,在最新的chromedriver更新89.0.4389.2300之后,Google chrome立即启动并崩溃。最奇怪的是,当我在本地运行它时,一切正常,但我也在使用Azure管道在服务器上运行测试。服务器给了我: OpenQA。硒。WebDriverException:未知错误:Chrome无法启动:崩溃。(未知错误:DevToolsActivePor

  • 我从GitHub下载了这个游荡的硒网格设置,并按原样试用了它。我可以让我的量角器测试在默认的Firefox实例上运行,但是当我尝试在chrome实例上测试时,我遇到了错误。这是当我尝试使用chrome运行测试时,节点vm的node.log文件的日志输出。 我尝试过使用openjdk 6 我目前正在使用量角器0.23.1。这是我的量角器配置文件: 我也尝试将下面的标志添加到conf/upstart/

  • Apache Ignite 2.1.0在Windows Server 12上启动时崩溃,默认为-config.xml。 日志的重要性: [11:08:16,455][INFO][main][IgniteKernal]语言运行时:Java平台API规范ver。1.8 [11:08:16,455][INFO][main][IgniteKernal]VM信息:Java(TM)SE运行时环境1.8.0_1

  • 当我打开我的android应用程序时,我总是会收到一个错误 应用程序app_name(进程com.random.stuff)意外停止。请再试一次 logcat 起始点: DDMS线路:

  • Apk在升级和添加另一个模块后与旧版本运行良好,我得到了这个错误 这是我的proguard规则,我已经定义了应用程序的前一个版本,运行良好,我添加了新的东西,但没有什么可以帮助我,任何人可以帮助这个问题,我被困在过去几天。