Hi Venkata,
You can use "REST Step" to execute/send the request messages. Below approach could be helpful in a test case:
1. Read the list of files from a specific location - (you can use "Load a set of File Names" dataset or script)
2. Once the filename is available, use the filename to read the content of it using "Read a File" step and save it in a variable
3. Use this variable in your rest step in content tab to send message to the server i.e.
http://myserver:2020/sampletest/V1
4. Once you get the response,
4.1. Use Json filters to capture different tags
4.2 Use Assertions to validate the status of test case
5. Write the status of test execution (In excel or DB along with FileName)
6.(Optional) Save the response file to a specific folder location for later references
Thanks.
------------------------------
Regards,
Vaibhav Jain
Capgemini
------------------------------
Original Message:
Sent: 09-11-2020 08:03 AM
From: Venkata S
Subject: Continuous testing/monitoring of JSON Requests
Hi,
This is a special need that we want to implement in our area. We want to set up kind of Continuous testing/monitoring for the given set of 'Request Samples' [of JSON format] which are placed in some LAN folder. We want all 'Request Samples' to be tested some specific weekday. Below is the quick approach of test that we have designed:
- Pick/select a Request Sample [.JSON] from the LAN folder.
- Submit the Request file to a server [http://myserver:2020/sampletest/V1], which processes the request, and provides Response.
- Parse the server Response [.JSON] to capture the headers info [viz., status, response-code,..] which would further used to categorize the test status [PASS/FAIL], and place the responses accordingly to 'Pass', 'Fail' folders of LAN.
- Have to repeat the Steps 1-3 for all other Request Samples [.JSON] of LAN folder.
However, I could make progress with Step#1, where I have developed bean shell code to iterate and read through ALL request sample files of the LAN folder. And here I'm looking for help on Step#2 and 3. Request you to share your views/thoughts on 'How to submit the JSON request to server' and 'How to parse the server Response for specific headers info'.
Your quick help greatly appreciated. Thank you !!