REST API Automated testing approaches


Did you know that it is possible to implement REST API Automated testing with JMeter? If no then this blog post might be interesting and show how powerful is JMeter. In this blog post, I would like to list pro and cons of using JMeter for automated REST API testing, so to non-technical and more general questions I will give answers. Also, I will compare different alternative approaches and tools with JMeter. Let’s start listing pros of using JMeter for automated testing:

  • Easy to write tests in JMeter
  • Free and open source
  • Maintainability of existing tests
  • Graphic interface
  • Supports non-RESTful services
  • Possibility to perform load and performance testing
  • Test recording
  • Built-in test results and reports
  • Integration with Jenkins or any CI

List of pros is pretty much impressive for software which is originally was not supposed to support functional testing. You can try to calculate how much it will cost to write framework which will cover all JMeter pros. I’m sure that you will get enough amount of budget to think about if it’s worth to write framework from scratch. Now let’s take a look at cons, which are for sure exist.

  • Test reusability
  • Extendibility
  • Integration with other testing frameworks
  • UI

Now let me aplify some of cons and the first is test reusability. With JMeter you don’t get flexibility which gives OOP, but still with “Include Controller” and “Module Controller” you can devide big tests into small parts and reuse them. But it will be tricky to pass arguments. Extendibility can be pro but I consider it as con because if you want to write some plugin you have to be familiar with JMeter API and it requires some amount of time. If you already have Selenium WebDriver tests or any automated tests it’s really hard to integrate them with JMeter. UI is at the same time is pro and con, because JMeter has specific UI and it’s not user friendly. It will take some time to get used to it.

Before making some conclusions, I would like to talk little bit about SoapUI. If you are not familiar SoapUI is actually API functional testing tool. It has open source free and commercial versions. Free version has everything you need to start testing REST API but at the end you will come up with idea that you have to buy commercial version. SoapUI is good competitor for JMeter.


If you have REST API which should not be integrated with other automated tests, i.e. when you run REST API tests independently and do not reuse them for example in Selenium WebDriver tests, then choose JMeter. If you have extra money to pay for commercial support, choose SoapUI commercial version. If you need to integrate your REST API tests with other tests then go for xUnit frameworks or RobotFramework.


Load testing Wordpress on cheapest cloud hosting plan

Nowadays the most of the cloud hosting companies are offering 5$ per month hosting plan, we wanted to know if this plan can be used in production and how much load it can handle. This article will include information about how much load can handle WordPress on the cheapest cloud hosting plan. We will reveal if the cheapest cloud hosting plan is marketing thing or it can solve some sort of problems for new starters.

Server set up and WordPress installation

For this load test, we won’t use any server-side nor web app optimizations. We will use cloud hosting built-in features such as “One-click apps” which deploys LEMP or LAMP Stack plus WordPress in one click. With few mouse clicks, we have the cloud server with WordPress installed. We choose LEMP Stack (Linux, Nginx, MySQL and PHP-FPM). Here are hardware properties:


$sudo lscpu

Architecture:          x86_64

CPU(s):                1

Thread(s) per core:    1

Core(s) per socket:    1

Socket(s):             1

CPU family:            6

Stepping:              2

CPU MHz:               1799.998

BogoMIPS:              3599.99

Virtualization:        VT-x

Hypervisor vendor:     KVM

Virtualization type:   full

L1d cache:             32K

L1i cache:             32K

L2 cache:              256K

L3 cache:              30720K

Continue reading “Load testing WordPress on cheapest cloud hosting plan”

Debugging JMeter with Wireshark

In this post, we consider the situation when JMeter request which was recorded with “HTTP(S) Test Script Recorder” does not work but if you repeat steps with browser everything works fine and if you have already tried to debug JMeter script but with no results. In more detail, you recorded HTTP request which should check some sort of API action but when run JMeter script occurring error. API, in turn, didn’t return accurate information about the error. If you try to repeat the steps using a browser then everything works fine. The first thing that may come to mind it so HTTP Cookie Manager, but if after adding HTTP Cookie Manager error persists then have to use Wireshark to see what is wrong. So, open Wireshark, select the network interface if you do not know what interface to choose, choose “any”.


Now run sniffing and write in the box Filter:

http.request.method == "DELETE"

Instead of “DELETE” you can assign “GET”, “POST”, “PUT” according to the method.


After that, open the browser and perform the steps that we need, if the connection between the browser and the server is encrypted you’ll have to decrypt Wireshark packets, but if not then you will see the requests sent. Now you need to save them in a text format, for this select “File” -> “Export” -> “as ‘Plain Text’ file …”. In the new window, select “All expanded”, “Displayed”, insert the name of the file. After that, we need to repeat the previous steps, but only need to capture requests through JMeter. After that, you will have two files with captured packets. Now run or install program Meld:

sudo apt-get install meld

Open the program and select two captured files to compare them.


screenshot_535After analyzing two files figured out that there was no “Content-Type” header in request and this was causing problem. Adding “Content-Type” header solved the problem. That’s it!


Interested in our services? Get a free quote! Contact us!

Howto debug JMeter scripts

In this article we examine debugging options in JMeter. I start from debugging on GUI level which helps during working with “Post Processors”. In this case we will debug “Regular Expression Extractor”. To make it work, add these elements into test tree:

  • Thread group
    • HTTP Request
    • Regular Expression Extractor
  • Debug Sampler
  • View Results Tree

Now you have to configure “HTTP Request” and “Regular Expression Extractor” and the rest of elements leave unchanged. Insert any server name, for example in “HTTP Request”. “Regular Expression Extractor” should be changed proceeding screenshot.


Now try to run your test, open “View Results Tree” and select “Debug Sampler”. On the right pane you see the list of Jmeter variables and also REGEXP variable with value.


Continue reading “Howto debug JMeter scripts”