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.
Sahi only generating DB logs of remote client executions
We have Sahi running on a headless unix box with jenkins, when our tests run the results are stored in the database regardless of the report type we put into the ant script.
The setup is that sahi starts up on the headless unix box to act as the controller calling nodes to remotely execute the test scripts, this seems to work except that it will not generate any report type outside of what is stored in the database. We need the junit reports to integration with our jenkins, so any help in pointing me in the right direction would be appreciated.
ant build.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="QA_Automation" default="main">
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<property file="properties/${env}.properties" />
<property environment="env" />
<property name="sahi.home" value="${env.SAHI_HOME}" location="/data02/sahi_pro" />
<property name="user.data" value="${env.SAHI_USERDATA_DIR}" location="${sahi.home}/userdata" />
<property name="userdata.dir" value="${env.SAHI_HOME}/userdata" />
<taskdef name="sahi" classpath="${sahi.home}/lib/ant-sahi.jar" classname="net.sf.sahi.ant.RunSahiTask" />
<taskdef name="sahisync" classpath="${sahi.home}/lib/ant-sahi.jar" classname="in.co.sahi.ant.DAntSync" />
<!-- Browser task definitions -->
<taskdef name="firef" classpath="${sahi.home}/lib/ant-sahi.jar" classname="in.co.sahi.ant.DAntRunner" />
<!-- Remote Sahi Windows Clients -->
<property name="node1" value="XXX.XXX.XXX.XXX" />
<property name="node2" value="XXX.XXX.XXX.XXX" />
<target name="Run_Tests">
<for param="file">
<path>
<fileset dir="test_suites">
<include name="${test}*.csv"/>
</fileset>
</path>
<sequential>
<propertyregex override="yes" property="Test_Suite" input="@{file}"
regexp=".*\/scripts\/"
replace="" />
<antcall target="Test-Run" />
</sequential>
</for>
</target>
<target name="Test-Run">
<echo message="Running the FireFox for Test Suite: ${Test_Suite}" />
<firef suite="scripts/${Test_Suite}"
sahihost="localhost"
sahiport="9999"
failureproperty="firef.failed"
haltonfailure="false"
browserType="firefox">
<!-- Does not output any report type at all, results always stored in DB only -->
<report type="junit" />
<node host="${node1}" port="9999" />
<node host="${node2}" port="9999" />
</firef>
<echo message="Browser Tests have completed ${line.separator}" />
</target>
<target name="Start-Sahi" description="start sahi server">
<echo message="Starting the Sahi Server" />
<!-- script to start the sahi it calls the userdata/bin/start_sahi.sh -->
<exec executable="/home/tomcat/start_sahi.sh">
</exec>
<sleep seconds="10" />
<echo message="Sahi Server started ${line.separator}" />
</target>
<target name="synconly">
<sahisync originFolder="${user.data}/scripts" destFolder="scripts"
ignorePattern=".*(.git|svn|copied).*">
<dnode host="${node1}" port="9999" />
<dnode host="${node2}" port="9999" />
</sahisync>
</target>
<target name="Stop-Sahi" description="stop sahi server">
<echo message="Stopping the Sahi Server" />
<sahi stop="true" sahihost="localhost" sahiport="9999" />
<echo message="Sahi Server stopped ${line.separator}" />
</target>
<target name="main" description="Main Job to run automation">
<if>
<and>
<not>
<equals arg1="${test}" arg2="Smoke_Tests" />
</not>
<not>
<equals arg1="${test}" arg2="Regression_Tests" />
</not>
</and>
<then>
<fail message="Cannot Identify Which Tests to Run....Valid Tests are Smoke_Tests or Regression_Tests" />
</then>
</if>
<!-- Replace Tokens with contents from environmental properties file -->
<replace dir="test_suites" replacefilterfile="properties/${env}.properties"/>
<antcall target="Start-Sahi" />
<antcall target="synconly" />
<antcall target="Run_Tests" />
<sleep seconds="4" />
<antcall target="Stop-Sahi" />
</target>
</project>
The setup is that sahi starts up on the headless unix box to act as the controller calling nodes to remotely execute the test scripts, this seems to work except that it will not generate any report type outside of what is stored in the database. We need the junit reports to integration with our jenkins, so any help in pointing me in the right direction would be appreciated.
ant build.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="QA_Automation" default="main">
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<property file="properties/${env}.properties" />
<property environment="env" />
<property name="sahi.home" value="${env.SAHI_HOME}" location="/data02/sahi_pro" />
<property name="user.data" value="${env.SAHI_USERDATA_DIR}" location="${sahi.home}/userdata" />
<property name="userdata.dir" value="${env.SAHI_HOME}/userdata" />
<taskdef name="sahi" classpath="${sahi.home}/lib/ant-sahi.jar" classname="net.sf.sahi.ant.RunSahiTask" />
<taskdef name="sahisync" classpath="${sahi.home}/lib/ant-sahi.jar" classname="in.co.sahi.ant.DAntSync" />
<!-- Browser task definitions -->
<taskdef name="firef" classpath="${sahi.home}/lib/ant-sahi.jar" classname="in.co.sahi.ant.DAntRunner" />
<!-- Remote Sahi Windows Clients -->
<property name="node1" value="XXX.XXX.XXX.XXX" />
<property name="node2" value="XXX.XXX.XXX.XXX" />
<target name="Run_Tests">
<for param="file">
<path>
<fileset dir="test_suites">
<include name="${test}*.csv"/>
</fileset>
</path>
<sequential>
<propertyregex override="yes" property="Test_Suite" input="@{file}"
regexp=".*\/scripts\/"
replace="" />
<antcall target="Test-Run" />
</sequential>
</for>
</target>
<target name="Test-Run">
<echo message="Running the FireFox for Test Suite: ${Test_Suite}" />
<firef suite="scripts/${Test_Suite}"
sahihost="localhost"
sahiport="9999"
failureproperty="firef.failed"
haltonfailure="false"
browserType="firefox">
<!-- Does not output any report type at all, results always stored in DB only -->
<report type="junit" />
<node host="${node1}" port="9999" />
<node host="${node2}" port="9999" />
</firef>
<echo message="Browser Tests have completed ${line.separator}" />
</target>
<target name="Start-Sahi" description="start sahi server">
<echo message="Starting the Sahi Server" />
<!-- script to start the sahi it calls the userdata/bin/start_sahi.sh -->
<exec executable="/home/tomcat/start_sahi.sh">
</exec>
<sleep seconds="10" />
<echo message="Sahi Server started ${line.separator}" />
</target>
<target name="synconly">
<sahisync originFolder="${user.data}/scripts" destFolder="scripts"
ignorePattern=".*(.git|svn|copied).*">
<dnode host="${node1}" port="9999" />
<dnode host="${node2}" port="9999" />
</sahisync>
</target>
<target name="Stop-Sahi" description="stop sahi server">
<echo message="Stopping the Sahi Server" />
<sahi stop="true" sahihost="localhost" sahiport="9999" />
<echo message="Sahi Server stopped ${line.separator}" />
</target>
<target name="main" description="Main Job to run automation">
<if>
<and>
<not>
<equals arg1="${test}" arg2="Smoke_Tests" />
</not>
<not>
<equals arg1="${test}" arg2="Regression_Tests" />
</not>
</and>
<then>
<fail message="Cannot Identify Which Tests to Run....Valid Tests are Smoke_Tests or Regression_Tests" />
</then>
</if>
<!-- Replace Tokens with contents from environmental properties file -->
<replace dir="test_suites" replacefilterfile="properties/${env}.properties"/>
<antcall target="Start-Sahi" />
<antcall target="synconly" />
<antcall target="Run_Tests" />
<sleep seconds="4" />
<antcall target="Stop-Sahi" />
</target>
</project>
Answers
I face to the same probleme. Have you find an issu?