Ben Weese

Category Archives: API Testing

Testing with Postman: All Notes

I decided to do a dump or a one stop shop for learning postman. You can go through my other post or just read this one. Testing Basics So to get started with postman you will need your API url and whether it is a GET, POST, PUT, DELETE or various other method. Your Developer […]

Testing With Postman: Newman

Next is to setup a DevOps job you can go here to learn how to do that. For this section we will focus on the Execute shell and newman. With this I suggest going through Postman’s official documentation found here. This takes your postman game and ups it to be able to be leveraged with […]

Testing with Postman: Lodash

Another javascript library built into Postman is Lodash. Looping Arrays with Lodash Sometimes you will want to iterate through an array. Maybe your response itself is an array. Luckily there is an easy for loop that can be used. This is use for where you see [] in the Json as that means what is […]

Testing with Postman: Moment

Postman has many built in Javascript libraries. Moment is one of the more useful ones for getting dates such as today’s date or tomorrow’s. Creating a Date with Moment Moment is another tool build into postman that can be used for your test. This is great for creating a rolling future, current or past date. […]

Testing with Postman: Chai Assertions

Postman uses the Chai Assertion Library so familiarize yourself with it. Using Chai Match Assertion You can define a format for your response using Regex and the match assertion. Below is an example of a data format for a mysql date. Date Format Multiple Assertions When using multiple assertions on a single data point you […]

Testing with Postman: Headers

Sometimes the only thing you need to test is a header. This is when a PDF or something else is returned. Below is how you can test a header. Testing for Correct Headers and PDF Responses Below are test you can run on headers. The great thing about this is it allows us to find […]

Testing with Postman: Variables

Sorry it has been a while but I recently moved job and house, so life has been hectic. Next we will discuss variables. There are a lot of different variables you can use like Collection, Environmental, path, and others. The main 2 I use are Environmental so that we can have different variables for Dev, […]