Nightwatch chromedriver error

+1 vote

Unable to run nightwatch tests on chrome.

Below is the modified nightwatch.json that I downloaded from nightwatch example:

{
  "src_folders" : ["./examples/tests"],
  "output_folder" : "./examples/reports",
  "custom_commands_path" : "./examples/custom-commands",
  "custom_assertions_path" : "",
  "globals_path" : "./examples/globals.json",
  "live_output" : false,

  "selenium" : {
    "start_process" : false,
    "server_path" : "/lib/sel-serv.jar",
    "log_path" : "",
    "host" : "127.0.0.1",
    "port" : 4444,
    "cli_args" : {
      "webdriver.chrome.driver" : "/lib/chromedriver/chromedriver.exe",
      "webdriver.ie.driver" : "",
      "webdriver.firefox.profile" : ""
    }
  },

  "test_settings" : {
    "default" : {
      "launch_url" : "http://localhost",
      "selenium_host" : "127.0.0.1",
      "selenium_port" : 4444,
      "silent" : true,
      "disable_colors": false,
      "screenshots" : {
        "enabled" : false,
        "path" : ""
      },
      "chrome":{
      "desiredCapabilities" : {
        "browserName" : "chrome",
        "javascriptEnabled" : true,
        "acceptSslCerts" : true
      }
      }
    },

      "desiredCapabilities": {
        "name" : "test-example",
        "browserName": "chrome"
      },
      "globals" : {
        "myGlobal" : "some_sauce_global"
      },
      "selenium" : {
        "start_process" : false
      }
  }
}

The error I get is this:

ERROR There was an error while starting the test runner:

Error: Invalid testing environment specified: chrome
    at Object.CliRunner.parseTestSettings (/usr/local/lib/node_modules/nightwatch/lib/runner/cli/clirunner.js:448:15)
    at Object.CliRunner.init (/usr/local/lib/node_modules/nightwatch/lib/runner/cli/clirunner.js:49:8)
    at module.exports.runner.runner (/usr/local/lib/node_modules/nightwatch/lib/index.js:546:17)
    at /usr/local/lib/node_modules/nightwatch/bin/runner.js:9:16
    at module.exports.cli.cli (/usr/local/lib/node_modules/nightwatch/lib/index.js:504:5)
    at Object.<anonymous> (/usr/local/lib/node_modules/nightwatch/bin/runner.js:8:14)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)

I also found an older post which says you have to create new file in root directory so give it a try and nothing happened

Mar 26, 2018 in Selenium by Shubham
• 13,480 points
1,752 views

1 answer to this question.

0 votes

You should use a dot before lib:

"webdriver.chrome.driver" : "./lib/chromedriver/chromedriver.exe",

and also in the selenium.jar:

"server_path" : "./lib/sel-serv.jar",
answered Mar 26, 2018 by nsv999
• 5,500 points

Related Questions In Selenium

0 votes
2 answers

Getting Error in System.setProperty of ChromeDriver

System.setProperty("webdriver.chrome.driver", ...READ MORE

answered Jan 8, 2019 in Selenium by anonymous
6,444 views
+1 vote
1 answer
+1 vote
2 answers

I'm Getting error as soon as I Initialize driver = new ChromeDriver();

Hi Prajwal, this type of error occurs ...READ MORE

answered Oct 11, 2019 in Selenium by Abha
• 28,080 points
17,888 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
6,510 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
6,724 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
4,341 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
5,378 views
0 votes
1 answer

Headless ChromeDriver using Python Selenium error: Fails To Start— “DevTools request failed”

This should be because your ChromeDriver is ...READ MORE

answered Mar 30, 2018 in Selenium by nsv999
• 5,500 points
1,026 views
0 votes
2 answers

TestNG error:- Cannot find class in classpath

The above link didn't work it means ...READ MORE

answered Feb 12, 2020 in Selenium by Rashmi Reddy PR
28,027 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP