views:

1071

answers:

2

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  A: 

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
Santi
A: 

You can stop selenium server ,using reference of selenium object.You can call this coding at button click....

selenium.shutDownSeleniumServer();

I have tried this code.

prakash.panjwani