OS:
Tested only on Windows 7 and Mac 10.10. This issue is not OS specific.
Selenium Version:
3.0.0
You see OKOK in the browser window and the server shuts down
Server is not shutdown. The browser page displays the following text.
Whoops! The URL specified routes to this help page.
For more information about Selenium Standalone please see the docs and/or visit the wiki. Or perhaps you are looking for the Selenium Standalone console.
Happy Testing!

duplicate of #2852
@lukeis
The solution given in the linked issue works when you are running with role as node.
It does not work when you run with role as standalone . Is there a way to shutdown the server when it is running in -role standalone.
doesn't appear so, no. This shut down command was an artifact of the Selenium RC server, which was removed in 3.0.
Do you have a particular use case you'd like to describe more?
I'm not inclined to add this feature to the standalone server.
Hi @lukeis ,
Thanks for getting back quickly.
We have use cases (especially during development) where we are not using the grid setup. We simply bring up the server with standalone role (on both local and remote machines) , run some tests and shutdown the server on test end.
Having the ability to shutdown the server programatically even when grid set up is not used is useful.
if you're able to launch the process on the remote machine, why can't you also kill it? And, why do you need to kill it?
In our current implementation, we do not get the process id back when we start the selenium jar, so the only option left is to kill the java process. Killing java blindly is not desirable as there can be other services running on that machine.
When moving to a newer version of selenium we first need to shutdown the server that is running and then deploy and start the new version. We also have a shared pool of machines that are used by different teams, some times of different selenium versions, so shutting down the server after test suite completion is important.
Is there a reason why you think shutdown is not necessary in standalone mode?
There's ways to determine which process id is binding on a particular port, so you don't have to blindly kill all java. And you obviously know the port number already.
It's not a normal type of service to provide to a server. There is not a compelling case to maintain such a thing. It's much more suited to be managed by other software controlling the machine's services (of which there's a large amount of tooling for different OS's and languages to help one with).
Thanks lukies
Regarding the tooling for controlling machines services, would really appreciate it if you could share any that you have used or familiar with for Windows and Mac
@lukeis I see this issue is closed, but I'm having the exact same issue. I use Selenium so I can test my applications. However, I don't want infinite running java processes. How can I stop the server without using the PID?
@ashkb @iltar
If the standalone server is listening on the default port (4444), this will send it a SIGTERM to terminate the process:
$ lsof -t -i :4444 | xargs kill
Imho Selenium should just provide a method of shutting down gracefully
a kill will do a graceful shutdown (using a higher interrupt level like kill -7 or kill -9 will cause it to not be graceful).
I might be willing to add a new command line flag like: -pidfile <required file location> for those who can't easily figure out how to get the process id (like on windows).
But having a remote shutdown endpoint is counter to most any server process I've come across. I can't think of another server that supplies such a thing.
If you really want the remote shutdown, then i suggest following the advice listed here https://github.com/SeleniumHQ/selenium/issues/2852#issuecomment-250841027 (you don't have to have a 'node' connected to a hub, you can disable the registration request and the poll to attempt to re-attach to a hub).
We have to test the 3 major browsers so we have to run test on windows to verify IE.
look at tomcat, it has shutdown hooks.
if your still supporting standalone server functionality then you should provide a way to shut it down.
look at tomcat, it has shutdown hooks
shutdown hooks are just a mechanism for executing custom code during a shutdown... they are not a method for initiating the shutdown.
you should provide a way to shut it down.
@cgoldberg @lukeis @mach6 Thank you for your responses. Both this post and #2852 are helpful. I understand the security implications and thus your hesitation of adding a URL to shut down the standalone server. On the same lines, I also understand that the servlet is just a stop gap solution and will also be decommissioned sometime in the future.
I believe this question keeps popping up on stackoverflow(and other such sites) because the instructions to get quickly started with selenium in https://pypi.python.org/pypi/selenium and other such credible online docs are not accompanied with shutdown instructions. Even if we implicitly know that organizations will use something like a supervisord to manage these standalone servers(if at all they use standalone servers), we should state these assumptions, security implications and simple instructions like these kill -9 in an appendix to the startup page. This will add confidence for more new users of selenium(like me) to get quickly started mess around and cleanup later.
Most helpful comment
@ashkb @iltar
If the standalone server is listening on the default port (4444), this will send it a SIGTERM to terminate the process:
$ lsof -t -i :4444 | xargs kill