Functional Testing 06: Getting Started with Debugging Your Tests

Unlike every software developer I have ever known, I make mistakes. And you will too, especially as you begin creating more and more complex tests. And when you see your tests doing things you don’t expect (or not doing things you do expect) it helps to know how to go about debugging the problem.

So, let’s take a break from building our tests and learn about a couple of the ways we can poke at JMeter to figure what’s going wrong when things don’t work.

Continue reading “Functional Testing 06: Getting Started with Debugging Your Tests”

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”

Functional Testing 03: But Wait! Not Too Lazy!

But Wait! addendum to tutorials are optional side topics, not necessary to continue progress through the tutorials, but that may skip ahead in concepts in order to expand on a topic.

In Functional Testing 03: Let’s Be Lazy you’ll notice I may have taken the laziness too far. In the tutorial I used the dreaded “copy and paste” method to create a second test. To those of us that have many, many tests this sends shivers down our spines. Our signin tests only had two tests but if we had wanted to run a hundred different signin tests copy and paste would not be the best solution.

So let’s take a little time to understand how we could remove the copy/paste.

Continue reading “Functional Testing 03: But Wait! Not Too Lazy!”

Functional Testing 03: Let’s Be Lazy

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

Sometimes laziness is a good thing. Sure laziness can result in nothing getting done. But laziness can sometimes result in MORE getting done. So let’s strive to be lazy, but lazy in a way that empowers us to do more!

In this tutorial, we will take what we’ve learned about Samplers and Variables, and combine it with some new concepts that will make our work reusable across our test plan. We will learn how to create a library of samplers which are parameterized to allow us to call them many different ways in many different tests.

Continue reading “Functional Testing 03: Let’s Be Lazy”

Functional Testing 02: Preparation is the Key to Success

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

A little preparation will save us tons of time later when everything changes. And everything is always certain to change.

After the fun excitement of the first tutorial in which we made our very first API call with JMeter, we are going step back and do some very boring preparation for the future. One thing we can be certain of is that changes happen in software projects. A small amount of effort put in early in a project can greatly help reduce the headache of updates and maintenance later down the timeline. So in this tutorial we start venturing down the path to setting up our test plan to be able to weather changes in API location, paths, and http ports, and more.

Continue reading “Functional Testing 02: Preparation is the Key to Success”

Functional Testing 01: Your First API Call

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

Let’s get started!

In our first tutorial we will learn how to setup a very basic HTTP Request Sampler to make a call to an API running on the internet. I will introduce  JMeter test plans, thread groups, HTTP Request Samplers, and View Results Tree Listeners.

Continue reading “Functional Testing 01: Your First API Call”