Functional Testing 08: Using Response Data – Part 2

Eighth in a series focusing on using JMeter for functional testing of an API.

In the last tutorial we used the response from Signin in to make another call to the API. Now we’ll take it one step further. We’ll introduce a little bit of validation to our Folders Sampler Library module in order to be able to make one more call to get the list of files within a folder. We’ll also introduce a little bit of randomness to our test, in a way that we will improve on in the next tutorial when things really start to get fun.

Continue reading “Functional Testing 08: Using Response Data – Part 2”

Functional Testing 05: Negative Validation or When Bad is Good

Fifth in a series focusing on using JMeter for functional testing of an API.

When is it good for a test fail? When you expect it to!

In the last tutorial we created validation on our Signin Library module to make sure that when we expected the test to pass that we got back the data we expected. Our test would then fail when we expected correct data but got something else. But what about when we need to make sure something correctly fails? What if we want to intentionally provide bad data and make sure that the application returns the correct error?

It’s called negative Validation, and we will tackle it in this tutorial.

Continue reading “Functional Testing 05: Negative Validation or When Bad is Good”

Functional Testing 04: Everyone Needs a Little Validation

Fourth in a series focusing on using JMeter for functional testing of an API.

So far we have relied solely on JMeter’s built in ability to tell if our API calls have passed or failed based on the HTTP response code we receive from the server. So a Signin response returning a 200 code would display as a pass (or success) and a 401 code would display as a failure.

This will often not be enough to validate the response from the server was in fact correct. The server could return a good response code but send bad data back which could cause problems down the line. In this tutorial we’ll enhance our Library module for Signin to validate that we are getting a token field in the response. It will be a very simple introduction to some more complicated validation we will do in a later module.

Continue reading “Functional Testing 04: Everyone Needs a Little Validation”