Property Transfer Source: groovy script, Target: SOAP reques
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2013
01:35 AM
09-11-2013
01:35 AM
Property Transfer Source: groovy script, Target: SOAP reques
Hi
I created a groovy script and i want to transfer directly my generated data/answer/result using TransferProperty to SOAP request without using Test Properties
thanks,
Jack
I created a groovy script and i want to transfer directly my generated data/answer/result using TransferProperty to SOAP request without using Test Properties
thanks,
Jack
9 REPLIES 9
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2013
03:35 AM
09-11-2013
03:35 AM
Please see if the below link helps
http://www.soapui.org/Scripting-Propert ... properties
Regards,
Rao.
http://www.soapui.org/Scripting-Propert ... properties
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2013
08:49 AM
09-11-2013
08:49 AM
Hi,
Uhm, my test steps are the following:
GroovyScript --> script to generate data
PropertyTransfer --> Source: Groovy Script Target: SOAP Request
SOAP Request
My goal here is i'm not using any Test Properties of use case, test suite and others as possible
Regards,
Jack
Uhm, my test steps are the following:
GroovyScript --> script to generate data
PropertyTransfer --> Source: Groovy Script Target: SOAP Request
SOAP Request
My goal here is i'm not using any Test Properties of use case, test suite and others as possible
Regards,
Jack
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2013
09:18 AM
09-11-2013
09:18 AM
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2013
12:52 AM
09-12-2013
12:52 AM
nmrao wrote: Sorry, please see this
http://www.soapui.org/Functional-Testin ... alues.html
Hi Rao,
You know any samples that the TransferProperty Source: Groovy Script?
Regards,
Jayson
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2013
01:44 AM
09-12-2013
01:44 AM
Hey,
In the first link provided has the sample how to set a value to a property and how to get the same. In this case, you would not require transfer property step at all. When property is used in the request, the value is automatically replaced when the request is sent.
For eg
There are two steps in a test case
Groovy
Test Step for soap request.
Groovy:
Request may look:
Note that you do not need to set any property value manually. At run time ${#TestCase#GENERATED_VALUE} will replaced with generated value run time automatically if test case is run or run groovy step first and then request step.
And smilarly you use properties at TestSuite, Project level as well. Hope this helps
Regards,
Rao.
In the first link provided has the sample how to set a value to a property and how to get the same. In this case, you would not require transfer property step at all. When property is used in the request, the value is automatically replaced when the request is sent.
For eg
There are two steps in a test case
Groovy
Test Step for soap request.
Groovy:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def timed = System.currentTimeMillis()
def myGeneratedValue = 'test_'+timed
testRunner.testCase.setPropertyValue("GENERATED_VALUE",myGeneratedValue)
Request may look:
<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<soapenv:Header/>
<soapenv:Body>
<Reference>${#TestCase#GENERATED_VALUE}</Reference>
</soapenv:Body>
</soapenv:Envelope>
Note that you do not need to set any property value manually. At run time ${#TestCase#GENERATED_VALUE} will replaced with generated value run time automatically if test case is run or run groovy step first and then request step.
And smilarly you use properties at TestSuite, Project level as well. Hope this helps
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2013
02:31 AM
09-12-2013
02:31 AM
Thanks Rao,
I figured it out!!!
groovy Scipt:
PropertyTransfer Test Step:
Transfer the value from groovy -> soap request
SOAP request
Regards,
Jack
I figured it out!!!

groovy Scipt:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def timed = System.currentTimeMillis()
def myGeneratedValue = 'test_'+timed
return myGeneratedValue
PropertyTransfer Test Step:
Source: Groovy Script Property: result
Target: SOAP request Property: Request
Transfer the value from groovy -> soap request
SOAP request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<soapenv:Header/>
<soapenv:Body>
<Reference>"value from groovy script"</Reference>
</soapenv:Body>
</soapenv:Envelope>
Regards,
Jack
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2013
02:55 AM
09-12-2013
02:55 AM
If i were you, do not use additional step - Property transfer which could be done groovy itself.
Regards,
Rao.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2017
09:57 AM
06-09-2017
09:57 AM
Hi Rao,
I was actually stuck on the same issue as well, and you explained it beautifully. I have a question though...
What if I want to create the property in a test suite or at a project level.. what changes to I need to make to the below script???
testRunner.testCase.setPropertyValue("GENERATED_VALUE",myGeneratedValue)
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2017
08:17 PM
06-10-2017
08:17 PM
Set property / its value at suite level
context.testCase.testSuite.setPropertyValue("GENERATED_VALUE",myGeneratedValue)
project level:
context.testCase.testSuite.project.setPropertyValue("GENERATED_VALUE",myGeneratedValue)
Regards,
Rao.
