Forum Discussion

ngambhir's avatar
ngambhir
New Contributor
10 years ago

single test case run multiple times different result location

Hi,

Please help me here..

My API URL looks like the following:

http://api-xx.xxxxxx.com/vX/jsonpostgw.aspx?m=somemoduleName

 

and in JSON body a simple JSON node with 3-4 entry.

Like this I need to test 200 odd similar looking API.

Hence I have created the following solution:

I have a excel which contains corresponding method,  JSON body and assertion field-value for the testable API.

A groovy script(EndToEndTest) is written in SOAIUI, which will read from the excel 1 by 1 and change the property filed(PropertyLooper) of the test case.

A REST test  step is then triggered which gets the input value from the Property Table and gets the REST response.

An Assert step is called then, which will check for the assertion value present in the property table.

Another groovy script called MainTestStepforLooping is run to call all the above test step in sequence.

 

Now My problem starts here..

I have written an ant xml as follows, which will run the required test case. But as this runs in loop my results are overide

 

<project name="soapUI Nightly Build" default="testreport" basedir=".">
<target name="soapui">
<exec dir="." executable="C:\Program Files (x86)\SmartBear\SoapUI-5.1.2\bin\testrunner.bat">
<arg line="-s'Sanity Test Suite' -cDataSetUp -j -f 'C:/soapUIReports' 'C:\Users\user\Documents\REST-Project-5-soapui-project.xml'"/>
</exec>
</target>
<target name = "testreport" depends ="soapui">
<junitreport todir="C:/soapUIReports">
<fileset dir="C:/soapUIReports">
<include name="TEST-*.xml"/>
</fileset>
<report todir="C:/soapUIReports/HTML"
styledir="C:/Ant/etc"
format="noframes">
</report>
</junitreport>

</target>

</project>

 

My Question:

How to I save multiple test run result of the same test case which I run again and again and see the combined results in JUnit report.

Please help I am stuck after coming so far. Please let me know if more information is required to understand the issue.

 

Thanks in Advance,

Nirmala Gambhir

3 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    You can use dynamic result location instead of static one like create a directory based on timestamp etc.
    • ngambhir's avatar
      ngambhir
      New Contributor

      Thanks for the reply. Can you please share sample code for the same, if you have?

       

      Regards,

      Nirmala Gambhir