I am introducing Selenium tests into my build for the first time. I figured that to do this in NAnt, I would have to start the WebDev server first:
<exec program="path/to/WebDev.WebServer.exe"
commandline="/port:51150 /path:path/to/website"
failonerror="true"
resultproperty="selenium.webdev.server.running"
spawn="true">
</exec>
Then start the Selenium server:
<exec program="path/to/java.exe"
commandline="-jar path/to/selenium-server.jar"
failonerror="false"
spawn="true">
</exec>
Then run my tests. This works. What i can't figure out is how do I kill the WebDev and Selenium servers when my tests have finished?
Here is what i do locally, but should work remotely too with a simple http get request:
http://localhost:4444/selenium-server/driver/?cmd=shutDown
or for post 1.0.1 versions of Selenium:
replace "shutDown" with "shutDownSeleniumServer"
James, I managed to solve Selenium starting/stopping problem by applying the test assembly initialization and cleanup mechanism (see the rest of the discussion on my blog):
Failing that, there's always the trusty old pskill. It's a big hammer approach, but it works a treat to kill off webdevwebserver :-)
I know very very little about selenium, so apologies in advance if pskill is no good for stopping it
We usually leave the Selenium server running all the time on our build servers, it's more practical that way.