Gatling is an open-source tool for performance and stress testing that is well worth adding to your personal tool knowledge repository. You may have already heard about Gatling if you are working in the performance testing field. Gatling has been around for close to a decade now and supports protocols like HTTP, WebSockets, and JMS (Jakarta Message Service). Even though it is Scala-based, which is not as popular as other languages, like C#, JavaScript, PHP, Python, and others, it is still widely used by developers. We’ll talk more about what makes Gatling a favorite load testing tool.
JMeter Load Testing with LoadView

How do you load test using Gatling?

Load testing with Gatling begins by selecting the correct language for your test platform. You can install Gatling and configure its encoding using the gatling.conf file. Running the load test includes developing scenarios for Gatling to run and record.

Is Gatling better than JMeter?

Gatling and JMeter have distinct advantages. Gating can produce more user-friendly test results thanks to interactive graphs. On the other hand, JMeter is more suitable for testing complex logic like those involving multiple message variants.

Is Gatling good for performance testing?

Gatling is an excellent choice for performance testing. It offers numerous advantages, including multi-platform capabilities, a detailed user dashboard, and the creation of load tests as code. Overall, it is a compelling performance-testing solution.

Which tool is best for load testing?

JMeter and Gatling are both excellent all-rounders. However, most load testing tools have notable advantages, and the best choice will depend on your needs. You should also consider other factors like pricing, deployment platform, and other parameters specific to your case.

Which language is used in Gatling?

Gatling’s code is in Scala, a programming language for Java Virtual Machines (JVM). This JVM base allows Gatling to work cross-platform, providing one of its most notable advantages in load testing.

What Is Gatling?

Gatling is a load testing tool that can be used with development environments, version control systems, and continuous integration solutions. It is commonly used by developers and performance engineers who want to define load tests as code and integrate them into CI/CD workflows.

Gatling is built on top of Akka, a toolkit for building distributed, message-driven applications. This architecture allows Gatling to simulate many virtual users efficiently without relying on one operating system thread per user. You do not need to understand Akka to run Gatling tests, but a basic understanding of Scala and the underlying model can help if you want to write more advanced simulations.

Gatling is lightweight and can generate a large number of virtual users from a single machine compared with some traditional performance testing tools. Because it is code-based, it gives technical teams flexibility when writing custom logic for performance scenarios. However, that flexibility also comes with a learning curve, especially for teams that are not comfortable with Scala, Java, or test-as-code workflows.

Gatling Key Features

Gatling offers several useful features compared with other performance testing tools. For the purposes of this article, we will cover a few of the key features and benefits.

Scala-Based Platform

Although Gatling is Scala-based, users can run basic tests without deep Scala programming experience. However, learning some Scala can make tests more flexible and maintainable. Gatling’s code-based approach gives technical users access to programming logic, reusable components, and version-controlled test scenarios.

HTTP Protocol Testing

Gatling is widely used for HTTP and API performance testing. Teams can configure requests, headers, bodies, authentication, checks, and assertions to validate backend behavior under load.

Gatling Recorder

Gatling includes a built-in script recorder. The recorder can intercept communication between your browser and server using proxy recording. It can also convert HAR files into Gatling scripts. This can be helpful for creating an initial script, although recorded scripts usually need cleanup, parameterization, and validation before they are ready for serious testing.

Continuous Integration

Gatling can be integrated into CI/CD pipelines. This makes it useful for teams that want to run repeatable performance checks as part of development and release workflows.

Why Gatling?

Gatling can be a strong tool when you want to load test APIs or backend services and you are comfortable with a code-based workflow. From a single JVM, Gatling can generate many concurrent users, depending on the test design and machine resources. For many protocol-level tests, you may not need to set up a large distributed network of machines.

Gatling is also useful for CI/CD because simulations can be stored in source control, reviewed like code, and executed automatically. It works well for teams that want to write performance tests programmatically instead of relying only on recorded scripts.

Now that we have a basic overview of Gatling use cases and features, we will walk through how to download and install it, run a sample script, and record a scenario. Later in this article, we will introduce LoadView as an alternative for teams that want managed, real browser-based load testing without setting up local tooling or writing code-heavy scripts.

Gatling Installation and Sample Script Execution

You can download Gatling from the official Gatling website. The sections below walk through a basic installation and sample script execution.

Installing Gatling from the Website

First, download Gatling from the official website.

Gatling has open-source and enterprise options. For the purposes of this article, we will use the open-source version for the demo. After the download is complete, unzip the folder. Everything needed to run the basic package is included in that folder, assuming your local environment meets the prerequisites.

Gatling Tutorials and Installation Requirements

Gatling provides learning tutorials and documentation. You can learn more from the official Gatling tutorials. Installation requirements vary by Gatling version, so review the current documentation before setup. In general, you need a supported Java Development Kit installed. Learn more about Gatling installation requirements.

After reviewing the official documentation and setting up the required prerequisites, open the unzipped Gatling folder and go to the bin folder. From here, you can run Gatling from the command line or by using the included startup scripts.

Gatling bundle

Gatling.bat

If you are using Windows, you can run gatling.bat. If you are using macOS or Linux, you can run the shell script. Gatling also includes example simulations that you can execute to confirm the installation works.

Gatling Sample Script Execution

Once you start Gatling, you will see a list of available simulations. Gatling includes default scripts that ship with the package.

For this example, choose [0] – Computer database.BasicSimulation, which is the computer database basic simulation. Type 0 and press Enter. Gatling will ask you for a test description. You can enter any valid description for the test.

Gatling BasicSimulation

The execution will start immediately. During the run, Gatling prints progress information to the console. After execution completes, Gatling generates a report in the specified location.

Gatling BasicSimulation Execution

Test Results

We will not get into detailed report analysis in this section. If you are familiar with other performance testing reports, the basics will look familiar. Gatling produces an HTML report in the output location. You can also adjust Gatling configuration options for reporting and simulation behavior.

Global Information Results

Gatling Global Information

Gatling Statistics Report

Gatling Statistics

You have now downloaded Gatling and run your first sample script.

Recording Using the Gatling Recorder

There are two main ways to create performance test scripts in Gatling: using the recorder or writing the simulation manually.

Gatling Recorder

The Gatling Recorder is a GUI-based HTTP proxy recorder. It can help users record a scenario and generate an initial Gatling simulation.

Manual Scripting

Manual scripting gives you more control, but it requires more knowledge of Gatling’s DSL, Scala or Java syntax, and performance testing concepts.

For this article, we will show a demo using the Gatling Recorder. The recorder is useful for getting a basic script in place, especially if you are new to Gatling. To start the Gatling Recorder, browse to the Gatling bin directory and run recorder.bat on Windows or recorder.sh on macOS/Linux.

Gatling Recorder.bat

Once you run the Gatling Recorder, you will see the configuration screen.

Gatling Recorder Configuration

Recording Modes

Gatling Recorder supports two primary recording modes.

HTTP Proxy Mode

HTTP Proxy mode captures traffic from your browser through a proxy. This can be useful, but it requires proxy configuration and may need additional setup for HTTPS traffic.

HAR Converter

HAR Converter converts an HTTP archive file into a Gatling simulation. This can be easier to use when you already have a HAR file from a browser or network capture tool.

The HAR Converter can be a good option because it gives you more control and usually has less recording setup overhead. It can also be easier for HTTPS websites. Ultimately, the best choice depends on your needs and level of expertise. You may want to try both options and choose the one that fits your workflow best.

There are other options you can configure, such as whether to follow redirects, where to save output, and whether to remove cache headers. For this walkthrough, we will keep the default options.

Gatling HAR Converter

Generate the HAR File for Gatling Recorder

There are multiple ways to generate a HAR file. You can use Chrome DevTools, browser developer tools, or network capture tools. In this example, we will use Fiddler. Fiddler is a network debugging tool that can capture client-server requests and responses. It can also help you remove unwanted requests before exporting the HAR file.

Convert a HAR File to a Gatling Script Using Recorder

Now we will create an HTTP archive file, or HAR file, using Fiddler. For demo purposes, we will use the LoadView website.

Important note: Do not execute performance tests against websites without permission. You can download Fiddler here. Installation and setup are straightforward. Once you have downloaded and installed Fiddler, launch it from your desktop.

Fiddler

In this example, Fiddler is configured to record only web browser and HTTP traffic. You can enable network capturing by selecting the web browser capture option. You can also learn about additional Fiddler recording options.

Record Your Scenario

Now you can start recording the scenario you want to use for performance testing by accessing it in a browser. In this example, we will navigate to the LoadView website and click About Us.

Gatling LoadView About Us

LoadView About Us

As the page loads in the browser, you can see the requests captured in Fiddler.

Fiddler LoadView About Us

Once you have captured your scenario, stop recording and search for LoadView. Remove unrelated requests so the HAR file only contains requests needed for the scenario.

Fiddler Results

Fiddler Requests

In this example, we removed unrelated requests and kept only the requests we needed. You can also remove tracker requests if they are not part of the scenario you want to test.

Fiddler Requests

Next, go to File > Export Sessions and save the request as HTTP Archive V1.2.

Fiddler Export Sessions

Fiddler Export Sessions

At this point, the HAR file is ready. If you use Chrome DevTools to create the HAR file, you may need to spend more time cleaning unrelated requests depending on the page and browser extensions. Fiddler can make that cleanup easier.

Open the Gatling Recorder and browse to the Gatling bin directory. Change the recorder mode to HAR Converter. Then browse to the HAR file you saved. There is an option to blacklist images, CSS, and other resources from the HAR file. You can also save your preferences for later use. Once the options are set, click Start to create the Gatling script.

Gatling Recorder HAR Converter

You will see a message when the HAR file is successfully converted into a Gatling simulation.

Gatling HAR Converter Successful

Gatling Simulation File

To review the generated Gatling simulation file, browse to the Gatling installation folder, open User-Files, and then open the Simulations folder. This is the default folder for simulations generated by the Gatling Recorder. You can open the file in a text editor or development tool. In this example, Notepad++ is used to view and edit the script.

Gatling Simulation File

 

Follow the same Gatling execution steps shown earlier to run the generated simulation and produce a report. Further script modification and simulation details can be found in the Gatling setup documentation.

Gatling Tutorial Conclusion

As shown above, Gatling is powerful, but it involves several steps, prerequisites, local setup, and script cleanup. For technical teams that already use code-based testing and CI/CD pipelines, that may be a good fit. For teams that want a faster path to browser-based load testing without managing local tooling, it may be more work than necessary.

That is why we will also walk through the same general process using the LoadView performance testing platform. LoadView is a cloud-based load testing solution that allows users to test websites and applications without needing a programming background or local load testing infrastructure.

Load Testing Using LoadView

LoadView allows users to handle scripting, execution, and reporting from the same cloud-based interface. Compared with the local Gatling setup above, the process is more guided. You script the user actions with the built-in recorder, configure a load pattern, choose load locations, and run the test.

Recording User Scenarios with the EveryStep Web Recorder

Again, the website we are going to test is LoadView, the same website used for the Gatling example. If you do not have a LoadView account, sign up is fast and easy, and you can receive free load tests to get started.

Select Your Load Testing Type

If you already have an account, navigate to LoadView and access the EveryStep Web Recorder. You can also open the recorder first and then log in to your account. Click New Test, and the LoadView recorder window will open as shown below. Select Web Applications.

LoadView Select a Load Testing Type

Once you click Web Applications, the EveryStep Web Recorder starts. Enter the web application address, which in this example is the LoadView website: https://www.loadview-testing.com/.

Device Compatibility Considerations

You can also test performance across different device profiles using LoadView. For example, if you are seeing issues only on mobile devices, you can select a mobile, tablet, or desktop profile based on your application requirements.

Enter your URL and click Record Now.

EveryStep Web Recorder LoadView

Begin Recording with the EveryStep Web Recorder

The recording starts immediately. Perform the steps or navigation you want to test. As you move through the site or application, the recorder captures each step and displays the recorded script details below the recorder.

End Your Recording

Once you complete your scenario, click Stop. Next, click Play Now to replay the script and confirm that it was recorded correctly. If there are errors in the script, the recorder will show an error message. If no errors occurred, you will see a success message. Save the script and modify it later if needed.

EveryStep Web Recorder Recording Stopped

Edit Your Scripts

After recording and replaying the script, you can enhance it based on the logic required for your test. LoadView supports context parameters, delays, correlations, and other script adjustments. Learn more about editing your LoadView scripts.

Setting Up Your Load Test

You will be prompted to create a new device to configure your load test execution. Name your device and continue through the setup. Additional fields under Settings, Completion Timeout, and DNS Options can be configured if needed for your goals. Read more about setting up your load tests. Once you are ready, select Create Device.

Configure Test Scenario

Choose the load type that matches your requirements. LoadView provides different load curve options based on your workload model. For this example, we will use the default settings and choose Load Step Curve.

LoadView Load Type

Load Injector Geo-Distribution

If you have a geographically distributed customer base, LoadView allows you to choose from load generators located around the world. It is best practice to generate load from the countries or regions where your website or application is used most often. This helps produce results that better reflect real user experience.

LoadView Load Injector Geo Distribution

Finalize Your Load Test Details

Once you have created your workload model, provide your email address so the load test report can be delivered to you. You can also schedule the load test for later. LoadView will start the execution at the scheduled time and send the report to the email address you provide.

LoadView Start Load Test

Start Your Load Test

Once everything is configured, click Start Test Now. After the load test begins, the status will change to Running. Give the load injectors a few minutes to start. You can view current test status in the Test Summary tab. Real-time load test data is available under the Execution Plan.

LoadView Execution Plan

LoadView Average Response Time

Cumulative Sessions and Errors

You can also review graphs such as total successful sessions and total errors by error type.

LoadView Cumulative Sessions and Errors

Load Test Report

After the test execution completes, the performance test report will be delivered to your email as a PDF attachment. You can also view the information in the LoadView console. The report can be shared with team members and internal stakeholders.

LoadView Load Test Report

And that is it. You have just performed a load test with LoadView. The process is straightforward and does not require complex coding, local hardware setup, or manual load generator management.

Gatling Load Testing: Wrap Up

If this was your first exposure to Gatling, you may still have questions, but you should now have a basic understanding of how Gatling works. Gatling’s major advantages are its code-based workflow, efficiency, and fit for CI/CD environments. It can be especially useful for teams that want to run protocol-level performance tests as code with tools like Jenkins.

However, Gatling may require more setup and technical knowledge than some teams want to manage, especially when writing or maintaining advanced simulations. If your team wants browser-based load testing, global load generation, guided scripting, and managed infrastructure, LoadView may be a better fit.

With LoadView, you do not need to spend extra time learning a new programming language or managing load generators. You can log in to the platform, record your script, configure the test, and execute the load test. You can then spend more time analyzing results, optimizing performance, and scaling your applications. Performance engineers are also available to help with setup, scripting, and testing if needed. Start your LoadView trial today!

If you are still researching performance testing tools, visit our Load Testing Alternatives page to compare tools and platforms such as BlazeMeter, k6, Flood.io, LoadRunner, and others against LoadView.