开发者

how to close selenium hub/grid from command prompt

I start Selenium hub to start Selenium Grid from command prompt on port 4444. Now I start Selenium RC from other command prompt.

It shows me error message that "Selenium is already running on port 4444. Or some other service is..."

Now I am not able to start S开发者_Python百科elenium RC. Please help me how to close /shutdown hub from command prompt.


http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer

is the command to close the opened selenium session. If the session is opened using batch file please remove the '@pause' command if its is used. This is useful when we are trying to stop and start the server during or in between test case execution.

Or

"Ctrl + C" is the best option.


Here is how you can shut it down

http://host-server:port/selenium-server/driver/?cmd=shutDownSeleniumServer


The URL command shutDownSeleniumServer is no longer supported as of Selenium 3.0.

This github issue suggests that the servlet that manages the lifecycle is still available, but accessible through a different URL:

http://{hubhost}:{hubport}/lifecycle-manager/LifecycleServlet?action=shutdown

If the server is running as a node, the servlet has to be enabled at runtime:

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

And the shutdown URL for a node is:

http://{nodehost}:{nodeport}/extra/LifecycleServlet?action=shutdown


You only need to hit this link http://localhost:4444/lifecycle-manager?action=shutdown


I am trying this we can also use our web browser to stop the server.

you can try following URL to shut down the server. http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer


You'll need to register your RC's with the Selenium Hub. Each RC needs to register on a different port (I think). You can use ant to boot the RC on a specific port

ant -Dport=5556 launch-remote-control

I found running the demos that come with Grid really helpful:

http://selenium-grid.seleniumhq.org/run_the_demo.html

hth


what is safer solution?

kill -p "$SELENIUM_PID"

or

wget http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer

i am making a init.d script for headless selenium and this is important step.


It's easiest to do from a browser (e.g. http://localhost:4444/selenium-server/driver/?cmd=shutDown), but you can also call that url with curl if you need command line access.


You can to press "ctrl"+"C" in command window, (where hub or RC is running) and to stop execution of batch file


To answer your original question of how do you close selenium hub from the command prompt, you can try this from the selenium-grid folder:
(from documentation)
rake all:restart
rake all:stop

Or for specific ports:
rake all:restart PORTS=5000-5010
rake all:stop PORTS=5000-5010


This (http://localhost:4444/lifecycle-manager?action=shutdown) link is removed under version 3.0. In windows, you must stop Java service.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜