【问题标题】:WCT is not able to detect google chrome browser in Redhat LinuxWCT 无法在 Redhat Linux 中检测到 google chrome 浏览器
【发布时间】:2018-10-05 23:00:28
【问题描述】:

WCT 在运行时无法在 Redhat Linux 中检测到 google chrome 浏览器

polymer test --skip-selenium-install

并抛出以下错误:

cli runtime exception: Error: {"value":{"stacktrace":"org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed\n  (Driver info: chromedriver\u003d2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform\u003dLinux 3.10.0-693.21.1.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 60.11 seconds\nBuild info: version: \u00273.8.1\u0027, revision: \u00276e95a6684b\u0027, time: \u00272017-12-01T19:05:32.194Z\u0027\nSystem info: host: \u0027user-docker\u0027, ip: \u0027172.18.0.2\u0027, os.name: \u0027Linux\u0027, os.arch: \u0027amd64\u0027, os.version: \u00273.10.0-693.21.1.el7.x86_64\u0027, java.version: \u00271.8.0_162\u0027\nDriver info: driver.version: unknown\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at next (native)
    at fulfilled (/home/user/IdeaProjects/project/node_modules/web-component-tester/runner/steps.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:109:7)

我们在 docker 容器中工作

我在下面尝试过,但都没有工作

  1. 聚合物测试 --local chrome

  2. sudo ln -s /usr/bin/google-chrome-stable /usr/bin/google-chrome

  3. 导出 LAUNCHPAD_CHROME=/usr/bin/google-chrome-stable


版本信息:

红帽 7.3
聚合物:v2.0.0
网络组件:v1.0.0
聚合物-cli:1.5.6


我已经打开了githubissue

【问题讨论】:

    标签: selenium-chromedriver redhat polymer-2.x wct


    【解决方案1】:

    我尝试进一步调试,发现我们无法在 docker 容器中启动 google-chrome,这会引发错误 Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted Trace/breakpoint trap (core dumped)

    因此,在调查该问题时,我发现 chrome 中存在一个问题,该问题阻止 chrome 在 docker 环境中启动。 run google chrome headless in docker.

    现在有了所有这些选项,我设法解决了这个问题。

    我正在使用 WCT 的配置文件并在配置文件中传递 --no-sandbox 选项。

    所以现在 WCT 正在启动 google-chrome

    我的wct.conf.json 文件是

    {
      "plugins": {
        "local": {
          "browsers": [
            "chrome"
          ],
          "browserOptions": {
            "chrome": [
              "--no-sandbox"
            ]
          }
        }
      }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-02
      • 1970-01-01
      • 2018-10-29
      • 1970-01-01
      • 2020-12-07
      相关资源
      最近更新 更多