Forum Discussion
nmrao
Champion Level 3
Have you checked below in script assertion?
log.info messageExchange.getResponseHeaders()
log.info messageExchange.getResponseHeaders()
kvsspkumar
8 years agoNew Contributor
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
- nmrao8 years agoChampion Level 3Not a separate Groovy Script test step. Add Script Assertion for the same request where you get the response.
- kvsspkumar8 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
- nmrao8 years agoChampion Level 3Use 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')
Related Content
Recent Discussions
- 15 years ago