How to integrate soapUI with Jenkins?

Michael picture Michael · Jul 11, 2011 · Viewed 81.1k times · Source

Anyone know a good way to add soapUI tests to my CI builds ?

Answer

Sebi picture Sebi · Jul 11, 2011

soapUI offers test automation via Maven or Ant. Maven integration is described HERE.

I tried it some month ago but had some strange issues with the eviware repository... Therefore I run my tests now via Ant. What you have to do is to call the testrunner.bat (or testrunner.sh) script in the soapUI bin directory. You can find the available arguments HERE.

You have to install soapUI on your Hudson build server. Then you simply create a new job which is built via Ant.

Sample build.xml:

<project name="IntegrationTest" default="soapui-tests" basedir=".">
    <description>Runs the soapUI integration tests</description>
    <property file="build.properties"/>

    <target name="checkos">
        <condition property="testrunner.cmd" value="${soapUI.home}/bin/testrunner.bat">
                <os family="windows" />
        </condition>
        <condition property="testrunner.cmd" value="${soapUI.home}/bin/testrunner.sh">
                <os family="unix" />
        </condition>
    </target>

    <target name="soapui-tests" depends="checkos">
        <exec executable="${testrunner.cmd}"
              failonerror="yes"
              failifexecutionfails="yes"
        >    
            <arg value="-e ${service.endpoint}"/>
            <arg value="-P dbUrl=${db.Url}"/>
            <arg value="-rajf"/>
            <arg path="${report.dir}"/>
            <arg path="${soapui.project.folder}"/>
        </exec>
    </target>
</project>