Need unique property to use for different Test Cases in SoapUI free

752 Views Asked by At

I am trying to reuse soap testcases into loadUi, but I am using the free version, so data driven testing, with excel or db is out of the question. Now my problem is I need unique ID for each virtual user, but this id has to be reused in the 2nd testcase the Test Suite.

I figured that:

TC1, ID

RPO_153480953${=javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar(GregorianCalendar.getInstance())} - unique

TC2, ID: Same as above, of course will not match because is a second later and the date isn't the same.

I did use "Property transfer" but that doesn't help since my function createa another unique id, and TC2 would have to reuse the property for TC1.

Can you please help me?

1

There are 1 best solutions below

0
Madhan On

I think you could easily achieve this by using groovy script Test step in SOAP UI and I hope it available in SOAP UI free version also.

Using the below code in TC1

groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );   
 ResHolder = groovyUtils.getXmlHolder("Request 1#Response" );  
  //Xpath_UniquID = proper xml path of generated Unique ID  
  UniqID = ResHolder.getNodeValue( Xpath_UniquID );   
  //Set UniqID to TestSuite properties
testRunner.testCase.testSuite.setPropertyValue( "UniqueID", UniqID  )

Here the value of "UniqID" set to Test Suite property "UniqueID" and you may fetch this value from any of the Testcase / Teststep in SOAP-UI TestSuite by using ${#TestSuite#UniqueID} in request xml of another Test case [TC2].

Hope it helps to solve your issue.

Thanks, Madhan