0

Running selenium webdriver with node and mocha on ubuntu 18.04 ...

Now I got these errors:

  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"
}

What details you need to give some more input? Is there any chance to debug this?

This is my base to play with atm. (https://github.com/bmshamsnahid/Automation-With-Selenium-And-Node.js)

naphetz
  • 1
  • 4
  • 1
    Read this: https://stackoverflow.com/questions/36429436/how-do-i-solve-server-terminated-early-with-status-127-when-running-node-js-on – DMart Sep 26 '19 at 18:27
  • Don't think there is an answer for me ... did that allready. – naphetz Sep 27 '19 at 10:05
  • @DMart i think this was a mocha prob. just installed it fresh. no i get new errors *douh – naphetz Sep 27 '19 at 11:24
  • The element cannot be found. Run it without headless to see what happens. Please update the code that you use, you may mistype the Id or class. – Dale Nguyen Sep 27 '19 at 13:05
  • No I've checked the selectors ... i think this should fit. i'm just playing around with this example: https://github.com/bmshamsnahid/Automation-With-Selenium-And-Node.js – naphetz Sep 27 '19 at 13:23

2 Answers2

1

Hi it seems that there is an isssue with certificate validation. You can disable it on chrome by using the following option : --ignore-certificate-error

Bruno Soufo
  • 21
  • 1
  • 2
0

If i remove the headless option i get this:

> 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.

If i understand this in the right way the solution for this error was to run it headless?

naphetz
  • 1
  • 4