Forum Discussion
6 Replies
Sort By
- SmartBear_SuppoSmartBear Alumni (Retired)Hi!
hmm.. how do you mean? Can you show some code?
regards!
/Ole
eviware.com - M_McDonaldSuper ContributorSure. The following code in the event:
def value = request.getProperty("Value").value
xmlResult = """<resultset>
<property name="Value">${value}</property>
</resultset>"""
context.httpResponse.responseContent = xmlResult
results in this reponse:
[tt:2xxc5tjj] [/tt:2xxc5tjj]
${#TestCase#Value}
I know I can wrap this in a context.expand(), but I would think that the value would have already been expanded for the request to be submitted. - SmartBear_SuppoSmartBear Alumni (Retired)Hi!
hmm.. I don't get the whole picture here.. what is the request object? (as far as I know the request object in soapUI doesn't have a getProperty(..) method)
Do you want to get some content from the actual sent request?
regards!
/Ole
eviware.com - M_McDonaldSuper ContributorThe code I had for this in a MockService used mockRequest.httpRequest.getQueryString() and then parsed that.
I didn't see an equivalent method for the event request but I noticed that request.getProperty() would get me (hardcoded) query parameters, but this didn't work for a query parameter that uses a property expansion.
See attached project. - SmartBear_SuppoSmartBear Alumni (Retired)ah!
sorry.. i was thinking soap-requests.. gotta have more modern thoughts.. :-)
Yes, you will have to do the property-expansion yourself with the context.expand(..), these methods will just give you whatever is typed into the parameter value..
regards!
/Ole
eviware.com - M_McDonaldSuper ContributorOK, thanks.