How to build common mock for error responses for different test suite/test cases?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019
03:04 PM
06-12-2019
03:04 PM
How to build common mock for error responses for different test suite/test cases?
Hi,
In my current project there are common respones for 400,500 error with respective to the servcices. I want to build a mock/stub where I should get 400 or 500 respone with repsect to the request.
Please suggest wehter it is possible to build dynmic mock which can be driven on request data?
Thank You,
Kailash
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019
09:11 PM
06-12-2019
09:11 PM
You can send some specific headers in the request, say header name SEND_RESPONSE_CODE=400 or 500
In the mock service, script dispatcher read that header is present and what code you want to return based on its have and send dynamic reply accordingly.
Hope this helps.
Regards,
Rao.
In the mock service, script dispatcher read that header is present and what code you want to return based on its have and send dynamic reply accordingly.
Hope this helps.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2019
04:12 AM
06-14-2019
04:12 AM
Thanks for reply , Sorry I forgot to mention I am creating mock for SOAP request and driving factor is test data.
Can you please suggest your view or solution for dynamic mock creation?
