# Gatling Recorder

## Recording a Script

To start Gatling Recorder, open the terminal on your computer and navigate to Gatling's bin directory using “cd” command.

* If you’re on windows you’ll need to run: `recorder.bat`&#x20;
* On the macOS or Linux Based OS you need to execute: `Sh ./recorder.sh`

```
loadium@localhost:~ erdem$ cd ~
loadium@localhost:~ erdem$ cd Downloads/
loadium@localhost:Downloads erdem$ cd gatling-charts-highcharts-bundle-3.5.1
loadium@localhost:gatling-charts-highcharts-bundle-3.5.1 erdem$ cd bin/
loadium@localhost:bin erdem$ Sh ./recorder.sh
GATLING_HOME is set to /Users/erdem/Downloads/gatling-charts-highcharts-bundle-3.5.1
```

![](/files/-Mdzz51BAvZt6jBAvGXC)

### Using .HAR File

In order to record a .HAR file you need to open the Chrome developer tools, Navigate to Network Section and start recording.

<figure><img src="/files/dYsUat9PT6ndKRiXMXzF" alt=""><figcaption></figcaption></figure>

After that you can right click and choose the "Save All As Har with Content". This should generate a .HAR file to use with Gatling.

{% hint style="info" %}
**Keep in mind:** Loadium also supports HAR files and it can convert your HAR files to JMX and run your tests with provided HAR File. Check "Convert" tab for more info.

&#x20;                                    ![](/files/cfY5jotpwc2JABQbc4X4)
{% endhint %}

Gatling Recorder can convert your HAR files easily to Scala you can simply switch the recorder mode to HAR Converter and select the HAR file. When you click to start it’ll convert your HAR Gatling Compatible Scala Test.

![](/files/-Me-0jfFttAXNogdW4hL)

### HTTP(S) Proxy Recorder

In order to record your first script you need to import your CA to your browser, after that you can use the proxy recording with Gatling.

Oops! Here comes the error. When we tried to exporting the CA from Gatling Recorder we welcomed by a roadblock. Even if we tried to Generate CA button on the Recorder it didn’t generated anything.

Here comes the thinking…

What we are gonna do?

How to Generate Certificate Authority For Gatling Recorder Proxy?

It’s as simple as writing 2 liner code, in fact literally two line code!

* Open the terminal on macOS or Linux Machine and type the following codes and hit enter

```
openssl genrsa -des3 -out rootCA.key 4096
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.crt
```

There should be two files created such as rootCa.key and rootCA.crt

* Import the .crt file to your browser and change your proxy settings to localhost:8000

![Uploading the certificate to Firefox browser](/files/-Me-3rkL2_FmwOFZ2iPa)

* Select the HTTP mode as Certificate Authority. Use the rootCA.crt file for CA Certificate and rootCA.key for CA Private Key.

![](/files/-Me-1YczPtXQLWqBmB4M)

Click the start and you’re ready to go.

## Running the Test

Open the terminal on your computer and navigate to bin directory using “cd” command.

* If you’re on windows you’ll need to run: `gatling.bat`
* On the macOS or Linux Based OS you need to execute: `sh ./gatling.sh`

![](/files/-Me-83scICewIHvj6NE-)

As you see you’ll see the recorded script and the demo scripts every script has its own number you can simply enter 0 and Gatling will begin testing.

![](/files/-Me-8DCk6iijCMhjIpWo)

## Automatically Generated Reporting

When test complete you’ll see results as shown above. In the last line you’ll notice a local url you can find your dashboard report using that url and the dashboard report is look like this:

![](/files/-Me0Czc7loyj9IrciDyu)

Enjoy Gatling test!

{% content-ref url="/pages/-MUSBc3iHQSjgBJ9Ppxx" %}
[Gatling Test](/create-test/gatling-test.md)
{% endcontent-ref %}

If you don't see the answer to your question here, please [reach out to us](https://loadium.com/contact-us/) to let us know! We're always improving our documentation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.loadium.com/gatling-corner/gatling-recorder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
