Skip to content

Load-Testing

Gatling: Post requests and modular scripts

This article is the fourth part of a series of tutorials dedicated to Gatling Load Testing.

We will focus on POST requests and script modularization:

In the previous blog post we created a realistic Virtual User that browses the store without buying anything. On the contrary, here we are going to simulate the behavior of a user that connects to the web store, searches for items, adds some to his cart and proceeds to the checkout. Then we will combine both Virtual Users to simulate a diverse load on the PetStore.

POST Requests

Most actions to simulate a user that connects to the store are done via POST HTTP requests. But what exactly is an HTTP POST request?

Gatling: Loops, Conditions and Pauses

This blog post is a guide to help you write Gatling scripts in order to load test web applications efficiently. It follows our second Gatling Simulation scripts parameterization article.

We will continue to load test a fake e-commerce, and so we are going to improve our Virtual User to make it browse the store in a more humanly way. To do it we will cover several topics:

  • Loops to make it browse several articles of each category,
  • Conditions to change its behavior depending on dynamic parameters,
  • Pauses to simulate a real user think-time.

We start where the previous blog post ended, with a simulation script that uses a CSV feeder and a Regular Expression extractor to visit dynamic pages of the pet store: Download Sample Script.

Documentation and Agile Performance Testing

Once upon a time documentation was one of the most important aspects of Quality Assurance and this was not limited to the functional test efforts but the non-functional testing as well.

We spent days, weeks, months even creating Performance Test Strategies, Approaches, Plans, Test Case, Completion Reports etc.

Most of these documents were required before any automation could be written and before a sensible performance testing framework could be considered.

It was expected before performance testing began, during the performance test cycles and after the tests completed it was a constant cycles of documentation creation, review, update, review and sign-off.

With a bit of Performance Testing in the middle.

Surely many of us remember the difficulty in getting some of these significant and lengthy documents approved by many, many stakeholders.

Before I go on to tell you why documentation is overrated I want to caveat it with the fact that for some organisations it is a necessity as they are following the wishes of their customers and clients, and for some organisations they still follow a strict waterfall approach to software development and their way of working delivers for their organisation.

This is all fine, this post is more about Documentation for Performance Testing in Agile Delivery and this is an important distinction.

Hidden Benefits of Performance Testing

If you are a performance testing specialist or a QA Manager or Programme Manager or anyone involved in the production of quality software then you understand why performance testing is required and its benefits in ensuring your products meet your Quality Criteria for release into production.

The costs of delivering performance testing are easily worth the investment as software that performs not only ensures you and your company have a reputation for delivering well performing software but business users will, in my opinion, overlook and embrace small functional workarounds if the software performs well.

As an investment it is worth the cost of building robust and reusable performance tests for the purposes of performance regression testing and that in itself will justify the cost of keeping them current and executable against the latest versions of code which is a maintenance activity that needs to continue as your product changes and evolves.

Some organisations leave their performance tests purely for the purpose of performance testing but there are other uses for these performance tests and by using them for these additional uses you can save time and money on the building and maintaining alternative tests.

We are going to look at some of the additional uses of performance tests in this post that will further justify the building of a complex performance testing suite.

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: