Eviware Forum

soapUI => soapUI => Topic started by: Manoj on January 30, 2008, 01:20:32 pm



Title: Using data of same/diff test suite values in diff teststeps
Post by: Manoj on January 30, 2008, 01:20:32 pm
Hi,

I want to use the out put(result) of one teststep1 as input of another teststep2 in the same test suite or in different test suite.
Is it possible through soapUI-Pro?
Ex- say I have temperature conversion wsdl which does 2 operations.
1- Conversions from Celsius to Fahrenheit
2- Conversions from Fahrenheit to Celsius.
Say In 1st operation I provided 10 and got 50 as response.
In the 2nd operation I should use 50 to get 10.
Is there any aoutomatic way the 2nd operation will take the 1st operation's out put value as input parameter to it?



Title: Re: Using data of same/diff test suite values in diff teststeps
Post by: omatzura on January 30, 2008, 10:02:58 pm
Hi!

If the TestsTeps are in the same TestCase, you can use either a PropertyTransfer or PropertyExpansion to transfer/get the desired value from the first response to the second request.

If the TestSteps are in different TestCases/TestSuites then you need to use a PropertyTransfer after the first request to transfer the desired value to a corresponding TestCase/TestSuite property, and then again a PropertyTransfer or PropertyExpansion for the second request to "use" this value.

Hope this helps!

regards,

/Ole
eviware.com


Title: Re: Using data of same/diff test suite values in diff teststeps
Post by: Manoj on January 31, 2008, 07:22:00 am
Hi Ole,

Thanks for your quick reply. I am using 1.7.6 version of soapUI.
I had done the above and able to do a property transfer in the same step by cloning the operation of diff test case to the same testcase.
But in the property transfer source step of test case1 , I can not find the property created in the test case2 or vice versa.
Is there any groovy that can solve the problem?


Title: Re: Using data of same/diff test suite values in diff teststeps
Post by: omatzura on January 31, 2008, 09:22:01 am
Hi!

yes, you can do this with groovy: after your first request create a groovy script that gets the property and writes it to a properties-step in the second testcase, from which you then can do a property-transfer before the request in that tescase. The script would be something like

def value = ..get property value using groovyutils/xmlholder..
def tc = testRunner.testCase.testSuite.getTestCaseByName( "seconds testcase")
def props = tc.getTestStepByName( "properties" )
props.setPropertyValue( "..", value )

Hope this helps,

regards,

/Ole
eviware.com


Title: Re: Using data of same/diff test suite values in diff teststeps
Post by: Manoj on February 01, 2008, 01:00:06 pm
Thank you so much Ole,