Jonathan Loiselle
Jonathan Loiselle

Reputation: 69

How can I reference a TestCase property from an AMF request TestStep script in soapUI?

I have a Test Case called "testCaseOne"

It contains three Test Steps:

"AMFrequestOne"

"propertyTransfer"

"AMFrequestTwo"

"AMFrequestOne" creates a database object.

"propertyTransfer" sends the ResponseAsXml to a temporary property in "testCaseOne" called "tempProp".

I need to reference "tempProp" in a script inside of "AMFrequestTwo"

I've tried the following

def temp = testRunner.testCase.getPropertyValue( "tempProp" )

but I get the error "No such property: testRunner for class: Script6" (number increments with tries)

Is this because in an AMF request "Script is invoked with log, context, parameters and amfHeaders variables" and testRunner is not recognized?

I know it seems odd, but is it possible to do this? I'm unable to use a specific xpath property transfer between the two AMF Requests as it's possible for the structure to change and I'm not always looking for the same node.

Upvotes: 1

Views: 2460

Answers (1)

Jonathan Loiselle
Jonathan Loiselle

Reputation: 69

Used

def temp = context.testCase.getPropertyValue( "tempProp" )

instead of

def temp = testRunner.testCase.getPropertyValue( "tempProp" )

and this works fine.

Upvotes: 4

Related Questions