-
Notifications
You must be signed in to change notification settings - Fork 4
2. Test Data set up using Virtualan
Virtualan has RESTAPI and user-friendly interface (UI) to set up the test data for your specific type of Rest APIs. This UI would help Developer, Functional Tester or Automation Tester to set up the test data for their specific use cases and test scenarios.
- End point Rest URL
- HTTP Verbs
- Query/Path/Header parameters
- Request message body
- Navigate to Virtualan UI with following URL: http://localhost/virtualan-ui.html#/
- From “Virtual Service” menu: select “Add Mock” drop-down:
- Select appropriate API operation that would need to set up
- This User interface would be grouped by API’s parent resource:
- For this case, it would be “pets” with different APIs
a) Set up the data for /pets – POST API
b) Populate the Request data with “Mock Request Body:” test area and Response would be in the “Mock Response:”.
c) Provided the above data, click on “Add” so that the mock response will be added.
d) A success message will be seen after you click on “Add”.
e) If you add the same “Request Test Data” again it would fail with the “Data already exists”.
f) Validation of the “Post” /pets API in postman(any Rest client):
- Open the Postman application and select http method as “Post”
- Enter the URL http://localhost/api/pets
- Enter the same Request information would be used to create the “Test Data”
- Response for the above “Post” API /pets request.
a) Set up the data for /pets/{id} – GET API
b) Populate the Request data in PathParam and Respose would be in the “Mock Respose:”
c) Provided the above data, click on “Add” so that the mock response will be added.
d) A success message will be seen after you click on “Add”.
e) Validation of the “GET” /pets/7001 API in postman(any Rest client):
- Open the Postman application and select http method as “Get”
- Enter the URL http://localhost/api/pets/7001
- Response for the above “Get” API /pets request.
a) Set up the data for /pets/{petId} – PUT API
b) Populate the Request data with “Path Param” and “Mock Request Body:” and Expected respose would be in the “Mock Respose:”.
c) Provided the above data, click on “Add” so that the mock response will be added.
d) A success message will be seen after you click on “Add”.
e) Validation of the “PUT” /pets/7001 API in postman(any Rest client):
- Open the Postman application and select http method as “Put”
- Enter the URL http://localhost/api/pets/7001
- Response for the above “Put” API /pets request.
a) Set up the data for /pets/{id} – Delete API
b) Populate the Request data in PathParam and expected response in the “Mock Response:”
c) Provided the above data, click on “Add” so that the mock response will be added.
d) A success message will be seen after you click on “Add”.
e) Validation of the “DELETE” /pets/7001 API in postman(any Rest client):
- Open the Postman application and select http method as “Delete”
- Enter the URL http://localhost/api/pets/7001
- Response for the above “Delete” API /pets request.
Virtualansoftware@2020