Forum Discussion
Hi Rao,
Thank you for your response.
Sorry I am not familiar with script assertion. When I ran the below statement as is in groovy it has thrown an error "no such property : messageExchange"
Can you guide on assertions please
Thanks
Kumar
- kvsspkumar9 years agoNew Contributor
Assertion worked with request message and returned a string with all properties very similar to below query in groovy.
${=context.testCase.testSteps["begin"].testRequest.response.messageReceive}
Now how can I pass the value from this string to testcase properties or next step request
- nmrao9 years agoCommunity HeroUse the same script assertion to retrieve and store data at test case level custom property and access those value later steps using Property Expansion.
to set / store a retrieved value:
context.testCase.setPropertyValue('PROP_NAME', 'string value')
To get value in later request steps using Property Expansion:
${#TestCase#PROP_NAME}
To get the value in groovy script steps:
context.testCase.getPropertyValue('PROP_NAME')- kvsspkumar9 years agoNew Contributor
Hi Rao,
I got this bit. Trouble i was finding is to get the property from the string returned by messageExchange.getResponseHeaders().
I realised I can get it messageExchange.getResponseHeaders().<propertyName> where <propertyName> is property I wanted to retrieve.
Thanks
Kumar