cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer parameters between Groovy scripts in SoapUI

Occasional Contributor

Transfer parameters between Groovy scripts in SoapUI

I have a `Groovy` script, it is present as a test step. I need to pass a parameter value from it to another `Groovy` script, which is in a script assertion, in a `SOAP` request. These are executed after each other. `Property Transfer` step is unable to do this.

1 REPLY
Highlighted
Community Leader

Re: Transfer parameters between Groovy scripts in SoapUI

Hi,

You can use the context object to pass the value.

// in groovy script
context.myvar = "somevalue"
// in script assertion
assert context.myvar == "somevalue"

See also the example SoapUI project file attached.

API Summer News

Congratulate last week's winners here:
1. @sanj - $50
2. @Sehuang and @aaronpliu - $35
3. @jhanzeb1 - $15

To do this week:
- Ask product-related questions
- Reply to any questions

Win $50, $35 or $15 gift card!
Winners will be decided next Monday (Aug 27)

Top Kudoed Authors
Are You In?