Hello everyone!

We have been investing plenty of personal time and energy for many years to share our knowledge with you all. However, we now need your help to keep this blog running. All you have to do is just click one of the adverts on the site, otherwise it will sadly be taken down due to hosting etc. costs. Thank you.

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>