Functional Testing 05: Negative Validation or When Bad is Good

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”