POSTMAN PRACTICE-1

Simge Ş.
5 min readAug 1, 2022

--

POSTMAN is a tool to send requests and arrange operations on an API. Postman is ready to fly and serve what we want to do, take a breath and follow numbers :)

In this story, we will use POSTMAN to create board, list, card and to change name of the card, delete card, write basic test. Before jumping into steps, you can take a look my previous stories.

Firstly, we need to create a workspace. It allows us to organize work and collaborate with our teammates.

  1. Press Workspaces and tab Create Workspace.
  2. Give a name and choose visibility, click Create Workspace as in Figure 1.
Figure 1 . Create Workspace

3. To create a new Collection you can press + button and give a name for it.

Do you know what the Collection means? Basically, it means a group of API requests. It is better to see similar requests in same folder, right ?

4. After you create a collection, it is time to see ADD REQUEST from (…) as in Figure 2.

Figure 2. Add Collection & Add request

So which end point and method we will add?
5. Before dealing with requests, create an account on Trello. Generate API Key & Token as shown in video below. (Developer-Trello)

Now turn back to application, we re ready to add requests with methods.

6. Firstly, we should create a board.

  • *Therefore go to The Trello REST API site, and
  • * Follow “Board-Create Board” path.
  • *You see the parameters and details about the request.
  • *Copy the URL from example on same page.
  • *Paste it next to POST method.
  • *You should see the parameters below automatically, and fill the values as in Figure 3 ,of course by using your key and token.
Figure 3. Create Board Request & Fill Values

7. Save the request before you press Send !

You should see “200” HTTP status code, if things go well.

Figure 4. Response for Create Board Request

Let’s check Trello Interface , to see our new board named MediumTrello.
Our baby board shown in Workspace :)

Figure 5. Created New Board in Trello

8. Create a list into new “MediumTrello” board.

Follow the path to copy URL from example to application. Well , how POSTMAN will know where to add list ?

When you take a look Figure 4 , we have “id” from our first call. We use it for idBoard key.

Figure 6. Create List & Fill values
Figure 7. Response for Create List Request

✓ We learned how to use the value from the previous call.

Hmm, did you realize we copy and paste API Key&Token again? Do we have to repeat this copy-pasting each time when we add request ?

The answer is no, because we automate as it supposed to be :)

9. Click Environment Quick Look button, and ADD Environment.

Figure 8. Environment Look & Add new variables

10. Fill the gaps with names of variables and values which we used.

Figure 9. Add variable and values

11. Now we try to use added variables in Create Card Request. Follow the path . Attention please :) don’t forget to choose Environment. (Figure 10)

Figure 10. Chosen Environment & Create Card Request

✓ We learned how to use environment variables for query parameters. ({{key}},{{token}},{{listId}})

12. Now we will use another method named “PUT”. To change name for created card, you should follow the path.

Figure 11. Put New Name to Card Request

Why the “cardId” is path variable? Path variables are used to identify resource where query parameters are used to filter those resources. In this example , we used it to reach specific created card URL.

Alright, I’d like to demonstrate how board is before we delete a card. At the end it should seen like Figure 12.

Figure 12. Board After POST and PUT methods

13. We delete updated card by DELETE method. Follow the path.

Figure 13. Delete Card Request

After sending delete request, you should see 200 Status code.

Turn back to Trello and check if it is deleted .

Figure 14. Card is Deleted From List

✓ We practiced POST, PUT, DELETE methods.

Finally we are ready to write a basic test !! :)

14. Choose Create Card request and direct to Test section.
Paste this code there :

pm.test(“Status code is 200”, function () {

pm.response.to.have.status(200);

});

This code tests whether card is created or not according to status code. If the status code is 200 , test will be passed.

Figure 15. Test Status Code
Figure 16. Test result is Passed

Thank you for reading :) This is the end of the path for now, I hope these baby steps help you to do some practices.

In next stories , we are gonna deal with more informations :)

--

--

Simge Ş.

Software Automation Test Engineer - ISTQB Certificated