![]() ![]() " pm.test( \"Status code is \" expectedResponse. " let expectedResponse = testData.response ", "let testData = pm.collectionVariables.get( \"testData \") ", "let testCaseName = pm.collectionVariables.get( \"testCaseName \") ", "let testCaseID = pm.collectionVariables.get( \"testCaseID \") ", "// Set the id value into an environment variable \r ", "description": "This is the API for the Contact List App: \n ", We have also covered advanced topics of Postman tool to do API Testing."_postman_id": "08eab573-4b04-4f9d-9580-c66adc06bef5 ", In the postman tool, you can save your requests and use them in the future based on your needs. (Postman also works with SOAP and GraphQL.) Define complex requests Send any type of request in Postman. Download the App Send requests and view responses Use Postman as a REST client to create and execute queries. Building Blocks of Postman:īefore testing an API, first we will see some building blocks of Postman Tool that are essential for every Postman operations.Ī request is a combination of the URL, HTTP headers, Body or Payload. Postman REST client Send requests, inspect responses, and easily debug REST APIs. Tests allow you to ensure that your API is working as expected, to establish that integrations between services are functioning reliably, and to verify that new developments haven’t broken any existing functionality. Tests: Tests are the scripts executed during the request. This is perfect for use-cases like including the timestamp in the request headers or sending a random alphanumeric string in the URL parameters.ġ8. Pre-request Script: Pre-request scripts are written in JavaScript, and are run before the request is sent. You can send various different types of body data to suit your API.ġ7. Body: It allows you to specify the data you need to send with a request. Headers: Some APIs require you to send particular headers such as JSON, JavaScript etc., along with requests, typically to provide additional metadata about the operation you are performing. We mention authorization details like username, password, bearer token etc., here.ġ5. Postman API testing by example API testing
0 Comments
Leave a Reply. |