BruceyBandit
BruceyBandit

Reputation: 4334

How to run multiple projects from SOAP UI and output a HTML Report using ANT

I am currently using ANT and SOAP UI free version to help generate HTML reports after running a project. This works successfully, now I want to be able to run multiple projects but I am not sure how to convert my build file to run multiple projects at a time.

Actually I want to know what is best practice where I want to be able to run multiple projects at a click of a button and all the projects are displayed in a single HTML report with their status. Can somebody show the processes to go through with examples of code so I know how this can be achieved? Running locally for now using command prompt for now.

Also I need to include selecting the correct environments, so I wonder if there is a way for me to enter in an environment. It would be good if a list of environments can appear in like a numbered list and the user selects the number and in the test report it shows which environment is used.

Below is the build.xml file where I run a project and it develops a report.

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Exclipse auto generated file.
          Any modifications will be overwritten.
          To include a user specific buildfile here, simply create one in the same
          directory with the processing instruction <?eclipse.ant.import?>
          as the first entry and export the buildfile again. -->

<project basedir="." default="xxx_Test_WebApi_Test_Report" 

name="xxx_Test_WebApi">


<target name="xxx_Test_WebApi_SoapUI">
 <exec dir="." executable="C:\Program Files\SmartBear\SoapUI-5.3.0\bin\testrunner.bat">
 <arg line="-r -j -f 'D:\xxx\Trunk\xxx.xxx.Test\SoapUI

\xxx_Test_WebApi\XMLReport' 'D:\xxx\Trunk\xxx.xxx.Test\SoapUI

\xxx_Test_WebApi\Test-API-soapui-project(v2).xml'"></arg>
</exec>
</target>


<target name="xxx_Test_WebApi_Test_Report" 

depends="xxx_Test_WebApi_SoapUI">
 <junitreport todir="D:\xxx\Trunk\xxx.xxx.Test\SoapUI

\xxx_Test_WebApi\XMLReport">
    <fileset dir="D:\xxx\Trunk\xxx.xxx.Test\SoapUI

\xxx_Test_WebApi\XMLReport">
        <include name="TEST-*.xml"/>
       </fileset>
    <report todir="D:\xxx\Trunk\xxx.xxx.Test/SoapUI

\xxx_Test_WebApi\HTMLReport">

    </report>
    </junitreport>
</target>

</project>

Upvotes: 0

Views: 2759

Answers (1)

Rao
Rao

Reputation: 21379

It is just simple.

You need to organize the targets accordingly.

For example, User has two soapui projects.

  • Define two targets in the build script which will just execute the project
  • Define another target, say generate.report

Now all you need to do is to call the targets appropriately.

For eg: below command will execute project1, project2 and then generate report.

ant project1 project2 generate.report

I would suggest not put any dependency between the targets.

Upvotes: 0

Related Questions