How to transfer request received in Mock Service into a test step
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to transfer request received in Mock Service into a test step
Hi,
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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.
import com.eviware.soapui.SoapUI
SoapUI.globalProperties.setPropertyValue( "requestData", requestData)
3. You can then access this property elsewhere (outside mock scipts etc) using
import com.eviware.soapui.SoapUI
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...
Cheers,
Rupert
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Cheers,
Zaid
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Zaid,
No problem, happy to have helped! 🙂
Thanks for the reply and marking the solution as accepted,
Cheers,
Rup
