nightwatch.jsnightwatch

Is there a way to execute system commands from within nightwatch?


I am looking to start some service using the command line tool from within the nightwatch. Searched a lot over the internet but found nothing related.

Appreciate if someone can provide an example to execute system commands.


Solution

  • You need to run the code using NodeJS code and definitely not NightwatchJS. I have noticed that you are trying to execute it using client.excute(). Please note that this runs in the browser and not in the system. You should explicitly run your system code using NodeJS and outside Nightwatchjs commands.