Configuring the JMeter HTTP(S) Test Script Recorder

The first step is to configure the proxy server in JMeter. To do this, we perform the following steps:

  1. Start JMeter.

 

  1. Add a thread group, as follows:
    1. Right-click on Test Plan and navigate to Add | Threads (User) |
      Thread Group.
    2. Right-click on Thread Group and navigate to Add | Logic Controller | Recording Controller.
  2. Add the HTTP(S) Test Script Recorder element, as follows:
    • Right-click on WorkBench and navigate to Add | Non-Test Elements | HTTP(S) Test Script Recorder.
  3. Change the port to 7000(1) (under Global Settings).
  4. You can use a different port if you choose to. What is important is to choose a port that is not currently used by an existing process on the machine. The default is 8888.
  5. Under the Test plan content section, choose the Test Plan>Thread Group (2)> Recording Controller option from the Target Controller dropdown.
  6. This allows the recorded actions to be targeted to the thread group we created in step 2.
  7. Under the Test plan content section, choose the Put each group in a new transaction controller (3) option from the Grouping dropdown.
  8. This allows you to group a series of requests constituting a page load. We will see more on this topic later.
  9. Click on Add suggested Excludes (4) (under URL Patterns to Exclude).
  10. This instructs the proxy server to bypass the recording requests of a series of elements that are not relevant to test execution. These include JavaScript files, stylesheets, and images. Thankfully, JMeter provides a handy button that excludes the often excluded elements.
  11. Click on the Start (5) button at the bottom of the HTTP(S) Test Script
    Recorder
    component.
  12. Accept the Root CA certificate by clicking on the OK button from the Root CA certification popup.

With these settings, the proxy server will start on port 7000, monitor all requests going through that port, and record them to a test plan using the default recording controller. For details, refer to the following screenshot:

Configuring the JMeter HTTP(S) Test Script Recorder
In older versions of JMeter (before version 2.10), the now HTTP(S) Test Script Recorder was referred to as HTTP Proxy Server.

While we have configured the HTTP(S) Test Script Recorder manually, newer versions of JMeter (version 2.10 and later) come with pre-bundled templates that make commonly performed tasks, such as this, a lot easier. Using the bundled recorder template, we can set up the script recorder with just a few button clicks. To do this, perform the following steps:

  1. Click on the Templates...(1) button right next to New file button on the toolbar, or by selecting File | Templates... from the menu.
  2. Then, select Select Template as Recording (2).
  3. Click on the Create (3) button. Refer to the following screenshot.
  4. Expand WorkBench | HTTP(S) Test Script Recorder. Change the port to your desired port (for example, 7000) instead of 8888 (the default value).
  5. Save Test Plan 6.
  6. Start the HTTP(S) Test Script Recorder by clicking on the Start button and then Accept the Root CA certificate by clicking on the OK button from the Root CA certificate popup:
Configuring the JMeter HTTP(S) Test Script Recorder through the template Recorder
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.23.30