Reputation: 1066
I am using npm package webdriver-manager to start driver on machine. It fails if the driver is already started.
Is there a way that I can stop and restart the webdriver? Or something like ignore if already started?
Upvotes: 8
Views: 9335
Reputation: 411
In bash you can close like this
kill $(ps -ef | grep webdriver | grep -v grep | awk '{ print $2 }')
Upvotes: 3
Reputation: 31
Found this in another post
# stop selenium
curl -s -L http://localhost:4444/selenium-server/driver?cmd=shutDownSeleniumServer > /dev/null 2>&1
Upvotes: 2
Reputation: 3731
If you're using Protractor, you can add seleniumServerJar
to your config file, and protractor will start/stop the selenium server for you.
exports.config = {
seleniumServerJar: "path/to/selenium-server-standalone-2.45.0.jar",
...
Upvotes: 5
Reputation: 913
This may be helpful ? https://www.npmjs.com/package/grunt-selenium-webdriver thanks.
Upvotes: 1