0

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?

Abhishek Asthana
  • 1,857
  • 1
  • 31
  • 51
  • I am confused you say that "but this id has to be reused in the 2nd testcase in the test suite" then you later say "but that doesn't help since my function creates another unique id and TC2 would have to reuse the property for TC1". which one is it? DO you want to reuse the uniqueid in TC2 or not? When you do a property transfer to the transfer to a property in test suite not TC2. It helps.. – Abhishek Asthana Aug 30 '13 at 15:58
  • I want to reuse the id from TC1 to TC2. But keep in mind that there is a date/time function there and it will generate another number of seconds for example. – user2572535 Sep 02 '13 at 06:34
  • Can you not use a property transfer step to transfer the value from TC1 to TC2? – Abhishek Asthana Sep 03 '13 at 11:40
  • If you are using the OpenSource version then create a property transfer step, create a property, in the source select TC1 and property as Request(thats where the random value exists, right?) and in the space below give the xpath to the tag which has the value. In the target step select TC2 and property as Request and here too give the xpath to the tag in the test request in TC2. This will work, i have tried it just not on an OS version. Now if you have the paid version, the steps are mostly similar except that you do not have to type the xpath soapUI provides you an option to do it. – Abhishek Asthana Sep 03 '13 at 11:55
  • check [this question](http://stackoverflow.com/questions/18539805/soapui-embbed-xml-in-a-request-using-groovy?noredirect=1#comment27331558_18539805) on SO this person also used a property transfer – Abhishek Asthana Sep 03 '13 at 11:56

1 Answers1

0

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

Madhan
  • 671
  • 2
  • 12
  • 25