![]() These code-snippets also exist for Pre-requests Scripts they can be used to dynamically generate parts of our requests, like headers or parameters. Right beside the text area, we can find code-snippets and a link to the scripts’ documentation of Postman. If we export it later, it can be found as a string inside our collection JSON. When we click Save, our test is saved besides our request inside our collection. We can see the result of this test after we clicked Send we just have to scroll down under the text area, we used to enter the test. In this test, we simply check if the response has a 200 status. When we click Send at the top right, the code is executed after Postman has received a response. Let’s add a test script by selecting the Test tab and pasting the following code into the text area: If we select our request, we can see Pre-requests Script and Test tabs below the text field where we entered our target URL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |