Skip to content

Load Testing Blog

Simple Way to Create Complex JMeter Scenarios

Creating complex performance testing scenarios in JMeter can be a complicated but necessary problem you will encounter as you build tests to mirror real user behaviour in your testing.

There are many add-ins that can support you in the creation of these scenarios. Which is good if they do what you want them to do. But if you want the flexibility to build tests without the limitations of 3rd party add-ins then there are several techniques you can use which come with the standard JMeter install.

All you require is a bit of imagination, a basic understanding of Groovy and the JMeter Switch Controller.

The resulting JMX script can be downloaded here.

JMeter Beanshell Server

The Beanshell Interpreter in JMeter can act as a server which as stated in the JMeter documentation is accessible by telnet or http.

So what, I hear you say, well this can be useful and we will explore some of these uses in this Blog Post.

Before we move on the definition of a Beanshell can be found on the official Web Site.

But at a high level:

You can use BeanShell interactively for Java experimentation and debugging as well as to extend your applications in new ways. Scripting Java lends itself to a wide variety of applications including rapid prototyping, user scripting extension, rules engines, configuration, testing, dynamic deployment, embedded systems, and even Java education.

In short, BeanShell is dynamically interpreted Java, plus a scripting language and flexible environment all rolled into one clean package.

So effectively the Beanshell can dynamically change properties or variables while the test is running.

Gatling: Simulation Scripts Parameterization

This blog post is a tutorial for writing Gatling scripts to load test web applications. It follows our first getting started with Gatling simulation scripts article.

The application under test is a fake e-commerce. We are going to create a Virtual User that browses articles in this shop. To create a dynamic load test we will cover several topics:

Gatling: Getting Started With Simulation Scripts

Gatling is a load testing tool for measuring the performance of web applications. As such, it supports the following protocols:

  • HTTP,
  • WebSockets,
  • Server-sent events.

Other protocols are also supported either by Gatling itself (like JMS) or by community plugins.

Gatling load testing scenarios are defined in code, more specifically using a specific DSL. This guide focuses on the basics of writing a simulation to test an HTTP application: OctoPerf's sample PetStore.

OctoPerf 11.6 - Automatic SLAs and other quality of life features

JMeter 5.2.1

In december, we updated OctoPerf to use the latest JMeter version. Although, as a minor version, it doesn't bring a lot of new features, it is always better to stay up to date with the latest bugfixes. We had to implement a small change in OctoPerf because JMeter now properly enforces the cache control headers in every situation. To avoid any confusion, cache control headers have now been disabled by default in OctoPerf:

Cache control

Simply because every script using a loop or calling the same page several times could be impacted by this change otherwise. You are welcome to activate them if required anyway.