Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to stop selenium server on click of button using java?

i have three projects generictest, testcase and testframework here generictest contains all the utility of selenium control. testcase contains all the testcases using junit and execute with selenium server and testframework show the qa dashboard it having two button start execution and stop execution and list of all testcases which are available in testcase project. if user start execution of testcases on click of start execution button and after a moment if he press stop execution button then browser not killed immediately and testcase execution not stopped. how can i manage to kill browser on click on stopexecution button and also stop execution of testcases...... suggest some solution for that.........


1 Answers

To close all the running tests with that button, take a look at the following:

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

In summary, what you need to do is open the following url for each session open using any http library:

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

Once all your tests are completed, open the following url using the same lib:

http://localhost:4444/selenium-server/driver/?cmd=shutDown
like image 86
Santi Avatar answered May 18 '26 01:05

Santi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!