How to stop selenium server when clicking a button using java?

I have three generictest projects, testcase and testframework, here the most typical one contains all the usefulness of selenium management. testcase contains all the test files using junit and runs with the selenium server and testframework, shows the qa panel with two launches of the start button and termination of execution and a list of all the test tables available in the testcase project. if the user launches test windows when the start button is pressed, and after a moment, if he presses the stop button, the browser will not be killed immediately, and the test will not be stopped. how can I kill the browser when I click the stopexecution button, and also stop the execution of test tables ...... suggest some solution for this .........

+3
source share
2 answers

To close all current tests using this button, review the following:

http://www.santiycr.com.ar/djangosite/blog/posts/2009/aug/25/close-remaining-browsers-from-selenium-rc

In general, you need to open the following URL for each session using any http library :

http://localhost:4444/selenium-server/driver/?sessionId=session-id&cmd=testComplete

Once all your tests are complete, open the following URL using the same lib:

http://localhost:4444/selenium-server/driver/?cmd=shutDown
+2
source

You can stop the selenium server using the link to the selenium object. You can call this encoding at the click of a button.

selenium.shutDownSeleniumServer ();

I tried this code.

+1
source

Source: https://habr.com/ru/post/1717899/


All Articles