![]() And execute N-Number of time requests repeatedly. In the above example, suppose we want to perform data-driven testing for Create Google Map location API, then we can store test data in CSV or JSON files. Users can test the end-to-end flow of the application in a single click using this feature. API sequencing will help to execute the API requests in the expected order. In the above example, we need to define the test execution sequence like Create Google map location (POST), Update Google map location (UPDATE), retrieve Google map location (GET), and delete Google Map location (DELETE). This script will apply only to individual requests. These scripts will apply to all requests which are present under the folder. These scripts will apply to all requests which are present under the collection. It will help in better readability of the execution report and avoid duplication of requests. We can add pre-request and post-request scripts to be executed before and after each request for the above scenarios. We should identify and list the reusable functions to reduce code repeatability and increase maintainability.Īdd pre-request scripts and post request script Run the tests and get the request pass/fail status. Moreover, only when something changes we need to update it in one place to reflect in all tests.įor the above scenarios, we need to add requests, and under the Test tab, we need to write tests and validate the response (status code, response time). We can use these variables in the script, making it readable and understandable. In that case, we should define the test data in global and local variables based on where they will be used. The same value we use in other HTTP requests like GET/PUT/DELETE requests to perform CRUD operations. In the above example, when we send POST requests to create a Google map location, then in the API response, we get “place_id”. It helps to maintain the requests as shown below.ĭefine local level and global level variables ![]() Suppose we want to create a Test suite like Smoke, Sanity, and System test requests, then we can create folders under the collection as per suite and Organise the API requests by placing them in their respective folder. It will reduce the testing efforts and number of requests. It will help to execute the above-created API requests in the required environment without changing test requests. If we want to execute a created request on different test environments like QA, Dev, Stage, and Prod, we need to create those required environments in Postman. DELETE request: To delete Google map location.GET request: To check whether Google map location is updated or not.PUT request: To update/edit created Google map location data.GET request: To fetch created Google map location data.POST request: To create a new Google map location.Then, as per requirement, we need to execute HTTP request methods in the below sequence: Then, define the sequence of requests to be executed.Ĭonsider the scenario where we need to add, view, edit, and delete operations on a Google map location. Understand application flowĪs per the API specification document, QAs should first understand and analyze end-to-end the flow of the application and decide on the testing scope. ![]() ![]() Now consider best practices to test the above scenarios. For this test, we need the below scenarios.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |