views:

109

answers:

1

At the moment i use selenium using HTMLSuite. The command i use to start the server and run the a testsuite is shown below

java -jar selenium-server.jar -htmlsuite "*iexplore" "http://localhost:8080" "C:\test\testsuite" "C:\test\result_%Yr%%Mth%%Day%.html"

I have some testsuites which have some sql scripts which need to be run first. The sequence of the way i want to run them is shown below

run sql script 1
run testsuite 1
run sql script2
run testsuite 2
run sql script 3
run testsuite 3

The sql script cant all be run at the same time so i have to run one script, run the selenium tests and continue with the next one.

I plan to put these commands in a Windows batch file but i am not sure how to stop the selenium server. The sequence of events in the batch job is like this

run sql script1
start selenium server
run testsuite 1
stop selenium server
run sql script 2
start selenium server
run testsuite 2
stop selenium server
run sql script 3
start selenium server
run testsuite 3

My questions really are:-

  • How do i stop selenium server from a windows batch job.
  • I think it is better to just start the server once. This will require the ability to control and access the current window. Is it possible to specify the current active window that is running the selenium tests?
+2  A: 

Here's a useful post that should help you do what you need.

gareth_bowles