Gatling Load Testing 101:Tools For Performance Testing!


Using Gatling Load Testing

Gatling Load Testing is one of the best tools for performance testing based on Scala-Akka-Netty that you can easily use by generating beautiful reports.

To download Gatling just access the link https://gatling.io/download/

Scripting

There are a few ways to script to run in Gatling all of which is well documented on the tool’s website.

Using Gatling Load Testing

The script we will make as an example uses the Gatling Recorder through a HAR file, in our case, it is from the page “globo.com”.

  1. Open the recorder;
  2. Then, select “HAR Converter” mode;
  3. Select the HAR file that you want to generate the script;
  4. Select the name of the class;
  5. In the Recorder, there are still some other options to explore. In our case, we do not want the script to contain static resources. So, clicking on the option “No static resources” already adds to the blacklist everything we do not want.
  6. After clicking Start, our simulation will be ready and the file in Scala has been generated and ready to be simulated.

What is Gatling testing?

How do you run the recorded simulation in Gatling?

Which is better JMeter or Gatling?

Which is the best load testing tool?

Generated reports

Now with the script ready, we can do our report. Just run Gatling, select the number of your simulation, and some description if you wish. Then, the simulation begins.

In the end, it generates an HTML report to visualize the information in more detail.

The main page displays a graph that shows the number of requests made in the script concerning time. By default, Gatling considers that the time below 800ms is good. Between 800 and 1200 is worrying, and above 1200 is bad, but this can be changed in the config file according to our needs.

By clicking on a request, we have detailed information about it which is the same information that was on the main page, except with a specific graph for it and with the separation of the information from the failed requests and those that were successful.

How to aim for less stressful performance tests with Gatling ?

Returning to the main screen, at the bottom, we have the graph of the number of users who were used in the simulation with time.

  1. The percentage of successful requests and that failed concerning the request time.
  2. The percentiles of successful requests throughout the simulation.
  3. The number of requests throughout the simulation.
  4. The number of responses throughout the simulation.

Performance testing in software testing

Performance testing in software testing helps to ensure that the software or applications perform properly under their workload. This testing technique is performed to determine the performance of the system in terms of stability, sensitivity, workload, and reactivity.

Hence, the process of performance testing helps to analyze the capability and quality of a product. This testing method helps us to determine the performance of the software in terms of speed, reliability, stability and different workloads. The performance testing process is also known as Perf testing.

Using Gatling Load Testing

Different attributes of performance testing are as follows-

Speed: Speed helps to determine whether the software product responds quickly or not.

Scalability: Scalability helps to know the amount of load which a particular software product can handle at a particular time.

Reliability: Reliability means whether the software product is secure or not.

Stability: A particular software product should be stable in cases of different workloads.

Objectives of performance testing

So, what is the main purpose of conducting the performance testing process? What goals or objectives does the process help us to achieve?

The objectives of conducting the performance testing process are as follows-

  1. Performance testing helps to eliminate performance congestion.
  2. It also helps to maintain the stability, reliability and credibility of our product software.
  3. Before launching the product, the product should be tested for various bugs or issues. Hence, the performance testing process helps to improve the product before launching it out to the audience.
  4. One of the most important objectives of performance testing is that it helps to make your software product rapid. This means your software product can respond quickly.

Performance testing types

After knowing the objectives of performance testing, you can initiate the process of performance testing, but before that, you should also know the various types of performance testing. Let us have a look at them.

  1. Load testing.

This type of performance testing helps the testers to verify the ability of a software product to perform under anticipated user loads. The main goal of performing load testing is to evaluate performance congestion before launching the product to all the people out there in the market.

  1. Endurance testing.

A good software product should be able to handle the expected load in a long period. Hence, endurance testing is performed to ensure that the software product can handle the expected load.

  1. Stress testing.

A software product should also be able to handle high traffic in extreme situations. Thus, stress testing helps to substantiate whether a product can handle high traffic under extreme workloads or not. The main objective is to recognize the breaking point of the software.

  1. Spike testing.

Despite testing helps to identify whether the product is capable to adhere to the large spikes in the load generated by the users.

  1. Volume testing.

Volume testing helps to know whether the overall system behaviour is accurate or not. It helps to check the performance of the product under different database volumes.

  1. Scalability testing.

Scalability testing helps to determine the effectiveness of a software application.

Gatling Load testing: Summing Up!

Now, we can start improving our Script by opening the Scala file generated by the Recorder and changing what is necessary.

You can delete requests that we consider unnecessary, edit the name of the requisitions to improve their identification in the reports, and test with the number of different users. Hence, now you must know about Gatling load testing which is one of the best tools for performance testing. You should also be able to answer the question- What performance testing is?