If you need stop and start selenium driver when running builds, you can use build.xml entry below. Make sure you have selenium-server-standalone-2.43.1.jar file stored in your project root.


Build.xml


<?xml version="1.0" encoding="UTF-8"?>

<project name="Inanzzz" default="default" basedir=".">

............

<!-- SELENIUM - STOP and START -->
<target name="selenium-stop">
<echo msg="Stopping Selenium ..." />
<exec logoutput="false" checkreturn="false" spawn="false"
command="wget -O - -q -t 1 http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer"
dir="./" />
<exec logoutput="false" checkreturn="false" spawn="false" command="sleep 5" />
</target>

<target name="selenium-start">
<echo msg="Starting Selenium ..." />
<exec logoutput="true" checkreturn="true" command="export DISPLAY=":99"" />
<exec logoutput="false" checkreturn="false" spawn="true"
command="java -jar ${project.basedir}/selenium-server-standalone-2.43.1.jar"
dir="./" />
<exec logoutput="false" checkreturn="false" spawn="false" command="sleep 5" />
</target>
<!-- END -->

</project>