Eğer selenium sürücüsünü build.xml ile durdurup ve tekrar başlatmak isterseniz, aşağıdaki kodu kullanabilirsiniz. Selenium-server-standalone-2.43.1.jar dosyasının uygulamanın içinde olması gerekir.


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>