How to access the request's endpoint in a scripted assertion?
In my soapUI project I am making heavy use of scripted assertions, i.e. I am constructing the strings against which to match the responses using Groovy scripts.
Some of our calls echo a "self-link", i.e. the contain a link that was used to request that message.
To generate the corresponding fraction of the comparison string I thus need the string from the "Endpoint" field in the request "form". That String is also contained in the "REST TestRequest Properties" tab as "Endpoint". How can I access this field as placeholder in a Groovy-String?
I tried using "${#TestRequest#Endpoint}" and "${#TestStep#Endpoint}" but these don't work. What would be the correct property designator for this "REST TestRequest"?
Hope I could make myself clear...
Michael
Hi Michael,
Does something like this work for you?
messageExchange.modelItem.testStep.httpRequest.endpoint
Regards,
Rupert
mmoser18, rupert_anderson has already provided answer.
And here is another simple way to get the same in Script Assertion:
context.endpoint