繁体   English   中英

使用 mocha 和 selenium webdriver 运行 npm 后出现错误

[英]errors after running npm with mocha and selenium webdriver

在 ubuntu 18.04 上运行带有节点和 mocha 的 selenium webdriver ...

现在我得到了这些错误:

  1) Google search automated testing
       find the input box and google search button:
     TimeoutError: Looking for element
Wait timed out after 15002ms
      at /root/test/node_modules/selenium-webdriver/lib/webdriver.js:834:17
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)

  2) Google search automated testing
       put keyword in search box and click search button:
     TimeoutError: Looking for element
Wait timed out after 15005ms
      at /root/test/node_modules/selenium-webdriver/lib/webdriver.js:834:17
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)



[mochawesome] {
  "killed": false,
  "code": 3,
  "signal": null,
  "cmd": "xdg-open /root/test/mochawesome-report/mochawesome.html"
}

您需要提供哪些详细信息才能提供更多信息? 有没有机会调试这个?

这是我玩atm的基地。 https://github.com/bmshamsnahid/Automation-With-Selenium-And-Node.js

您好,证书验证似乎存在问题。 您可以使用以下选项在 chrome 上禁用它:--ignore-certificate-error

如果我删除无头选项,我会得到:

> googlesearch@1.0.0 test /root/test
> mocha test --reporter mochawesome --reporter-options autoOpen=true



  Google search automated testing
    1) "before each" hook for "find the input box and google search button"
    2) "after each" hook for "find the input box and google search button"


  0 passing (456ms)
  2 failing

  1) Google search automated testing
       "before each" hook for "find the input box and google search button":
     WebDriverError: unknown error: Chrome failed to start: exited abnormally
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
      at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:550:15)
      at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:563:13)
      at Executor.execute (node_modules/selenium-webdriver/lib/http.js:489:26)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)

  2) Google search automated testing
       "after each" hook for "find the input box and google search button":
     WebDriverError: unknown error: Chrome failed to start: exited abnormally
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
      at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:550:15)
      at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:563:13)
      at Executor.execute (node_modules/selenium-webdriver/lib/http.js:489:26)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)



[mochawesome] {
  "killed": false,
  "code": 3,
  "signal": null,
  "cmd": "xdg-open /root/test/mochawesome-report/mochawesome.html"
}

npm ERR! Test failed.  See above for more details.

如果我以正确的方式理解这一点,则此错误的解决方案是无头运行?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM