How to transfer request received in Mock Service into a test step
I am using a mock service in SoapUI to test the request to request transformation of a webservice.
Can someone please tell me how can i capture the request that is received in the mockservice and add it to a test step in my test suit where i have triggered this SOAP request.
Any help is HIGHLY appreciated. Thanks
Solved! Go to Solution.
As I can't remember if it is possible to access a mock request using a property expansion (it may be, but I never have and someone else may be able to help?), my first thought was to:
In the mock's OnRequest script
1.Capture the request data e.g. something like def requestData = mockRequest.requestContent
2.Store it in a Global property e.g.
SoapUI.globalProperties.setPropertyValue( "requestData", requestData)
3. You can then access this property elsewhere (outside mock scipts etc) using
def requestData = SoapUI.globalProperties.getPropertyValue( "requestData")
Does this sound of any use?
A related, but slightly different mock data transfer situation, including more options for storage, was discussed a while ago in this post: http://community.smartbear.com/t5/SoapUI-Open-Source/Need-to-use-response-elements-from-one-mock-ope...
Thank you Rupert! that helped me immensely to update the script i had. Also thanks for the related article im sure ill be using it at some point.
No problem, happy to have helped! 🙂
Thanks for the reply and marking the solution as accepted,