18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
ANT Build Fails but passes
Good day,
I have a situation where my ANT build should fail due to a timeout, but passes regardless of this.
I have worked of the DEMO.xml file, reducing it quite a bit before my final working copy.
Below, notice that for the target "runffandfail", I removed "failsahi" because this would fail the the test continuously.
here is the output for that run :
<?xml version="1.0" encoding="UTF-8" ?>
- <testsuite errors="1" failures="0" name="Payments2.xlsx." tests="1" time="172.976">
- <testcase classname="Payments2.xlsx." name="Payments2.xlsx" time="172.976">
- <error message="Assertion Failed">
- <![CDATA[ Step >_sahi._click(_sahi._label("Developers' Central Reliable, scalable, customisable. Integrates with your system via APIs."))< did not complete in 150 seconds.
]]>
</error>
1684Payments2_firefox__31Mar2014__10_18_18_172Payments2.xlsxC:\Users\suveer.prithipal\sahi_pro\userdata\scripts\Central\Payments2.xlsx2014-03-31 10:18:18.172nullRUNNINGnullnullnullnullfirefox a=a baseURL=http://sahi.co.in/demo/ browserOption=-profile "$userDir/browser/ff/profiles/sahi$threadNo" -no-remote browserPath=C:\Program Files (x86)\Mozilla Firefox\firefox.exe browserProcessName=firefox.exe browserType=firefox emailProp= host=localhost language=english logsInfo=junit:C:/Users/suveer.prithipal/sahi_pro/userdata/temp/junit/tests port=9999 sahisid=sahi_17b3dd270f1e304a220ba1b048577e7ac8c3 suiteId=sahi_17b3dd270f1e304a220ba1b048577e7ac8c3 suiteName=Payments2.xlsx suitePath=C:\Users\suveer.prithipal\sahi_pro\userdata\scripts\Central\Payments2.xlsx suiteReportId=Payments2_firefox__31Mar2014__10_18_18_172 threads=6 useSystemProxyS=false userDefinedId=sahi.co.in_firefox_englishsahi.co.in_firefox_englishnullnullnull
</testcase>
</testsuite>
Here is the xml :
<project name="jenkins-sample" default="ff">
<property name="userdata.dir" value="C:/Users/suveer.prithipal/sahi_pro/userdata"/>
<property environment="env"/>
<property name="urlbase" value="sahi.co.in"/>
<taskdef name="sahi" classname="net.sf.sahi.ant.RunSahiTask" classpath="C:/Users/suveer.prithipal/sahi_pro/lib/ant-sahi.jar"/>
<target name="ff" description="start the server and run sahi tests">
<parallel>
<sequential>
<waitfor maxwait="3" maxwaitunit="minute" checkevery="1000">
<http url="http://localhost:9999/logs/"/>
</waitfor>
<antcall target="runffandfail"/>
</sequential>
<antcall target="start"/>
</parallel>
</target>
<target name="runfftests">
<sahi suite="C:\Users\suveer.prithipal\sahi_pro\userdata\scripts\Central\Payments2.xlsx" browserType="firefox" baseurl="http://${urlbase}/demo/" sahihost="localhost" sahiport="9999" failureproperty="sahi.failed" haltonfailure="false" userDefinedId="sahi.co.in_firefox_english" threads="6">
<customfield key="language" value="english"/>
<report type="junit" logdir="${userdata.dir}/temp/junit/tests"/>
</sahi>
</target>
<target name="start" description="starts proxy">
<java classname="net.sf.sahi.Proxy" fork="true">
<classpath location="C:/Users/suveer.prithipal/sahi_pro/lib/sahi.jar">
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/rhino/js.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/apc/commons-codec-1.3.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/license/truelicense.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/license/truexml.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/db/h2.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/poi/dom4j-1.6.1.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/poi/excelpoi.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/poi/poi-3.7-20101029.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/poi/poi-ooxml-3.7-20101029.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/poi/poi-ooxml-schemas-3.7-20101029.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/poi/xmlbeans-2.3.0.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/c3p0/c3p0-0.9.5-pre5.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/c3p0/mchange-commons-java-0.2.6.2.jar"/>
<fileset dir="C:/Users/suveer.prithipal/sahi_pro/extlib" includes="*.jar"/>
</classpath>
<arg value="C:/Users/suveer.prithipal/sahi_pro/" id="basePath"/>
<arg value="C:/Users/suveer.prithipal/sahi_pro/userdata/" id="userdataPath"/>
</java>
</target>
<target name="stopsahi" description="stop sahi server">
<sahi stop="true" sahihost="localhost" sahiport="9999"/>
</target>
<target name="failsahi" if="sahi.failed">
<fail message="Sahi tests failed!"/>
</target>
<target name="runffandfail" depends="runfftests, stopsahi"></target>
<target name="sahitests" description="start the server and run sahi tests">
<parallel>
<antcall target="start"/>
<sequential>
<waitfor maxwait="3" maxwaitunit="minute" checkevery="100">
<http url="http://sahi.co.in:9999/_s_/spr/blank.htm"/>
</waitfor>
</sequential>
</parallel>
</target>
<target name="runieandfail" depends="runietests, retryfailed, stopsahi, failsahi"></target>
<target name="runietests">
<sahi suite="${userdata.dir}/scripts/demo/demo.suite" browserType="ie" baseurl="http://sahi.co.in/demo/" sahihost="localhost" sahiport="9999" failureproperty="sahi.failed" haltonfailure="false" userDefinedId="sahi.co.in_english" threads="6">
<customfield key="language" value="english"/>
<report type="html" logdir="${userdata.dir}/temp/html/tests"/>
</sahi>
</target>
<target name="retryfailed" if="sahi.failed">
<sahi suite="${userdata.dir}/scripts/demo/demo_failed.suite" browserType="ie" baseurl="http://sahi.co.in/demo/" sahihost="localhost" sahiport="9999" failureproperty="sahi.failed" haltonfailure="false" userDefinedId="sahi.co.in_english" threads="1">
<customfield key="language" value="english"/>
<report type="html" logdir="${userdata.dir}/temp/html/tests/retry/"/>
</sahi>
</target>
</project>
I have a situation where my ANT build should fail due to a timeout, but passes regardless of this.
I have worked of the DEMO.xml file, reducing it quite a bit before my final working copy.
Below, notice that for the target "runffandfail", I removed "failsahi" because this would fail the the test continuously.
here is the output for that run :
<?xml version="1.0" encoding="UTF-8" ?>
- <testsuite errors="1" failures="0" name="Payments2.xlsx." tests="1" time="172.976">
- <testcase classname="Payments2.xlsx." name="Payments2.xlsx" time="172.976">
- <error message="Assertion Failed">
- <![CDATA[ Step >_sahi._click(_sahi._label("Developers' Central Reliable, scalable, customisable. Integrates with your system via APIs."))< did not complete in 150 seconds.
]]>
</error>
1684Payments2_firefox__31Mar2014__10_18_18_172Payments2.xlsxC:\Users\suveer.prithipal\sahi_pro\userdata\scripts\Central\Payments2.xlsx2014-03-31 10:18:18.172nullRUNNINGnullnullnullnullfirefox a=a baseURL=http://sahi.co.in/demo/ browserOption=-profile "$userDir/browser/ff/profiles/sahi$threadNo" -no-remote browserPath=C:\Program Files (x86)\Mozilla Firefox\firefox.exe browserProcessName=firefox.exe browserType=firefox emailProp= host=localhost language=english logsInfo=junit:C:/Users/suveer.prithipal/sahi_pro/userdata/temp/junit/tests port=9999 sahisid=sahi_17b3dd270f1e304a220ba1b048577e7ac8c3 suiteId=sahi_17b3dd270f1e304a220ba1b048577e7ac8c3 suiteName=Payments2.xlsx suitePath=C:\Users\suveer.prithipal\sahi_pro\userdata\scripts\Central\Payments2.xlsx suiteReportId=Payments2_firefox__31Mar2014__10_18_18_172 threads=6 useSystemProxyS=false userDefinedId=sahi.co.in_firefox_englishsahi.co.in_firefox_englishnullnullnull
</testcase>
</testsuite>
Here is the xml :
<project name="jenkins-sample" default="ff">
<property name="userdata.dir" value="C:/Users/suveer.prithipal/sahi_pro/userdata"/>
<property environment="env"/>
<property name="urlbase" value="sahi.co.in"/>
<taskdef name="sahi" classname="net.sf.sahi.ant.RunSahiTask" classpath="C:/Users/suveer.prithipal/sahi_pro/lib/ant-sahi.jar"/>
<target name="ff" description="start the server and run sahi tests">
<parallel>
<sequential>
<waitfor maxwait="3" maxwaitunit="minute" checkevery="1000">
<http url="http://localhost:9999/logs/"/>
</waitfor>
<antcall target="runffandfail"/>
</sequential>
<antcall target="start"/>
</parallel>
</target>
<target name="runfftests">
<sahi suite="C:\Users\suveer.prithipal\sahi_pro\userdata\scripts\Central\Payments2.xlsx" browserType="firefox" baseurl="http://${urlbase}/demo/" sahihost="localhost" sahiport="9999" failureproperty="sahi.failed" haltonfailure="false" userDefinedId="sahi.co.in_firefox_english" threads="6">
<customfield key="language" value="english"/>
<report type="junit" logdir="${userdata.dir}/temp/junit/tests"/>
</sahi>
</target>
<target name="start" description="starts proxy">
<java classname="net.sf.sahi.Proxy" fork="true">
<classpath location="C:/Users/suveer.prithipal/sahi_pro/lib/sahi.jar">
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/rhino/js.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/apc/commons-codec-1.3.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/license/truelicense.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/license/truexml.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/db/h2.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/poi/dom4j-1.6.1.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/poi/excelpoi.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/poi/poi-3.7-20101029.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/poi/poi-ooxml-3.7-20101029.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/poi/poi-ooxml-schemas-3.7-20101029.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/poi/xmlbeans-2.3.0.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/c3p0/c3p0-0.9.5-pre5.jar"/>
<pathelement location="C:/Users/suveer.prithipal/sahi_pro/extlib/c3p0/mchange-commons-java-0.2.6.2.jar"/>
<fileset dir="C:/Users/suveer.prithipal/sahi_pro/extlib" includes="*.jar"/>
</classpath>
<arg value="C:/Users/suveer.prithipal/sahi_pro/" id="basePath"/>
<arg value="C:/Users/suveer.prithipal/sahi_pro/userdata/" id="userdataPath"/>
</java>
</target>
<target name="stopsahi" description="stop sahi server">
<sahi stop="true" sahihost="localhost" sahiport="9999"/>
</target>
<target name="failsahi" if="sahi.failed">
<fail message="Sahi tests failed!"/>
</target>
<target name="runffandfail" depends="runfftests, stopsahi"></target>
<target name="sahitests" description="start the server and run sahi tests">
<parallel>
<antcall target="start"/>
<sequential>
<waitfor maxwait="3" maxwaitunit="minute" checkevery="100">
<http url="http://sahi.co.in:9999/_s_/spr/blank.htm"/>
</waitfor>
</sequential>
</parallel>
</target>
<target name="runieandfail" depends="runietests, retryfailed, stopsahi, failsahi"></target>
<target name="runietests">
<sahi suite="${userdata.dir}/scripts/demo/demo.suite" browserType="ie" baseurl="http://sahi.co.in/demo/" sahihost="localhost" sahiport="9999" failureproperty="sahi.failed" haltonfailure="false" userDefinedId="sahi.co.in_english" threads="6">
<customfield key="language" value="english"/>
<report type="html" logdir="${userdata.dir}/temp/html/tests"/>
</sahi>
</target>
<target name="retryfailed" if="sahi.failed">
<sahi suite="${userdata.dir}/scripts/demo/demo_failed.suite" browserType="ie" baseurl="http://sahi.co.in/demo/" sahihost="localhost" sahiport="9999" failureproperty="sahi.failed" haltonfailure="false" userDefinedId="sahi.co.in_english" threads="1">
<customfield key="language" value="english"/>
<report type="html" logdir="${userdata.dir}/temp/html/tests/retry/"/>
</sahi>
</target>
</project>