![]() ![]() ![]() 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. Allows to collaborate and work with teams.Allows integrating with CI tools like Jenkins using the Newman Command line tool.Easy to maintain execution order of requests. ![]() Facility to create multiple environments and maintain test data (Global and Local level).Easy to create and maintain requests in the folder structure.There are several API testing tools available, such as POSTMAN, SOAP UI, JMeter, REST-Assured, Katalon Studio, etc, and QAs prefer to use the Postman tool over others. It acts as an intermediary to communicate between two applications or electronic devices over the world wide web (API supports different HTTP methods like GET, POST, PUT, and DELETE in the browser. API stands for Application Programming Interface. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |