Skip to content

Load Testing Blog

JMeter ForEach Controller

Among the many elements JMeter offers for creating test scenarios, the ForEach loop stands out as an efficient way of browsing and processing data.

The ForEach loop in JMeter is a controller that allows you to cycle through the elements of a list or variable, executing the test samples included in the loop for each element iteratively. This is particularly useful when you need to perform tests with dynamic data, or when you want to repeat a sequence of samples for different values.

  • Save time and effort:
  • The ForEach loop simplifies the management of test scenarios involving dynamic data, reducing complexity and development time.

  • Improved maintainability:

  • By using the ForEach loop, test scenarios remain easily understandable and modifiable, facilitating long-term maintenance.

  • Dynamic test scenarios:

  • Allows tests to be adapted to real-life situations by iterating over variable data sets.

Uploading Images in JMeter

In this blog post we are going to look at simulating the process of uploading an image to a web-site in JMeter for load testing.

Image uploading is a relatively straightforward process to simulate in JMeter. There are a few different ways to approach this, which we will explore.

In order to follow along, you can download the sample JMX here.

Setup

Before we start to look at uploading images with JMeter, we are going to need a test site to use.

We will use an online image upload site for the purposes of this blog post as it makes the upload process easy to follow.

You may have an image upload site in your organization, or you may be reading this for understanding how to upload image to an application you are testing. In any case, the way JMeter handles uploading images is the same.

Tracing Slow Performance

You have built your performance test and executed the tests under load and your tests do not meet your requirements in terms of response times.

Or you are unable to execute your tests with the number of concurrent users required.

In this post we will give some insights into where you might want to start looking for the root cause of your performance issues.

These insights are very high-level, and the architecture of your application will determine which ones are of use and which are not as will the language your application is written in and the database technology it uses.

Performance Testing and ChatGPT

Performance testing applications requires a set of skill that are build and gathered over many years of studying and using the various techniques and tools that are required to make sure the application you are testing is fit for production. Now we have all heard of Artificial Intelligence (AI) and the many tools and companies that now exist in the AI space.

Based on a quick look on the internet there are around 15,000 AI startups in the United States alone. So surely with all that technology at our disposal we should be able to use these AI tools to define our performance tests meaning that anyone can determine what performance testing should take place regardless of experience and training.

To build, execute and analyse these tests still requires a competent performance tester but the definition of what should be done could be handed over to Artificial Intelligence right? Let’s find out shall we, we will use ChatGPT as this commonly available and probably the one most have heard of.

Performance Testing in a Scrum Framework

Agile development teams generally follow the principles of Scrum where individual teams work together to manage their workload through a set of values, principles, and practises.

From a development perspective this gives a team which comprises a Product Owner, Scrum Master, and Development team the autonomy to work and deliver in an environment that suits their needs and helps them develop change for the organisation in a way that maximises efficiencies.

This blog post is not an overview of the scrum methodology but will require some understanding of the processes that take place, and these will be discussed throughout his post. What we are trying to do is understand how in an Agile delivery framework we can make sure that performance testing is not lost or overlooked. Scrum teams work in short sprints that means that your performance testing must, like the unit testing built by the development teams, be lightweight and, well... agile, for want of a better word.