Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium 2: How to check that server is running and stop the server?

With Selenium 1 there was the possibility to enter a URL to stop the server:

http://:/selenium-server/driver/?cmd=shutDown

Is there a similar way in Selenium 2?

I tried the following URL to check whether the server is running:

http://:/wd/hub/

but that only returns an HTTP ERROR 503 (service unavailable). Is there any other URL I can access to verify that the server is running?

like image 479
Peter Meier Avatar asked Jun 29 '11 08:06

Peter Meier


People also ask

How can I tell if Selenium server is running?

Or You can also check with http://localhost:4444/selenium-server/driver/?cmd=getLogMessages If serveris runnning then it will show 'ok' in browser.

How do I stop a Selenium server from running?

find the PID of the process that is bound to port 4444 (use lsof command) send that process a SIGTERM to gracefully shutdown (use the kill command)

How do I start Selenium standalone server from command prompt?

To install and start the standalone Selenium Server manually, use the webdriver-manager command line tool, which comes with Protractor. Run the update command: webdriver-manager update This will install the server and ChromeDriver. Run the start command: webdriver-manager start This will start the server.


1 Answers

The Selenium server in 2.0 contains all of the same code that was in Selenium 1, so checking for, say, http://localhost:4444/selenium-server/driver?cmd=getLogMessages will test for the existence of the server. Likewise, you can issue http://localhost:4444/selenium-server/driver?cmd=shutDownSeleniumServer to shut the server down.

There was recently a new /status URL added to the JSON wire protocol used by the 2.0 parts of the server, but I'm not certain it's been implemented in the remote server just yet. This would be accessed by http://localhost:4444/wd/hub/status, when implemented. Additionally, there isn't yet an equivalent shutdown URL in the wire protocol.

like image 80
JimEvans Avatar answered Sep 21 '22 14:09

JimEvans