selenium: shutDownSeleniumServer return 404 after upgrade from Selenium 2 to 3 (beta4)

Meta

OS: Ubuntu, docker Selenium Version: 3.0.0-beta4 revision: 3169782 Browser: Chrome or Firefox

Expected Behavior

curl -s 'http://localhost:${NODE_PORT}/selenium-server/driver/?cmd=shutDownSeleniumServer'
#=> OKOK

Actual Behavior

curl -s 'http://localhost:${NODE_PORT}/selenium-server/driver/?cmd=shutDownSeleniumServer'
#=> 
<html><head><meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 </title></head><body><h2>HTTP ERROR: 404</h2>
<p>Problem accessing /selenium-server/driver/. Reason:
<pre>    Not Found</pre></p>
<hr /><i><small>Powered by Jetty://</small></i></body></html>

Steps to reproduce

  1. Upgrade selenium standalone jar from 2.53.1 to 3.0.0-beta4
  2. Try to /selenium-server/driver/?cmd=shutDownSeleniumServer

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 22 (10 by maintainers)

Most upvoted comments

@elgalu actually, per my suggested approach we already have a servlet you can optionally include when running as a node. It’s called LifecycleServlet

$ java -jar selenium-server-standalone-3.0.0-beta4.jar -role node -servlet org.openqa.grid.web.servlet.LifecycleServlet

Then

$ curl -s http://{nodehost}:{nodeport}/extra/LifecycleServlet?action=shutdown

I tested this with beta4.

Closing this as a result. Please re-open if you see a need to.

@zenonwch
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":4444"') do taskkill /F /PID %%a How that breaks down: for /f "tokens=5" %%a in () do - For each line from the output of the bracketed command, store the 5th column in %a and run the following command 'netstat -aon ^| findstr ":4444"' - Output all network process with PID, and filter by lines containing :4444 taskkill /F /PID %%a - Forcibly kill the process with the PID stored in %a. I’m running this in a batch file. It seems you just can use %a instead of %%a when running in cmd.

Adding some more info on this;

It seems this is a RC server command which is not supported in the Se3 leg-rc package.

  • To get past the 404, you need to add the leg-rc package to the CLASSPATH
  • Then, you’ll see GET is not supported…
  • If you POST it, you’ll get a 500 java.lang.NullPointerException

Personally, I don’t see the need to support this command. Instead I think we should include (in our jar) an optional -servlet which adds the ability to shutdown a node via a HTTP request.