Apache JMeter Apache JMeter: Test scenario recording Script Recording with the JMeter Template Feature


Example

In version 2.10, JMeter introduced a mechanism that saves you time when creating scripts - JMeter Templates. These templates are skeletons that can be reused as the base for your new scripts.

JMeter already has several available templates with detailed descriptions, and you can also add your own. Templates have all the required configuration and elements to record your performance scripts from scratch.

Here’s how to use the JMeter Template Feature:

Configure JMeter

  1. Open JMeter

  2. Select the template for script recording:
    File -> Templates… -> Select Template -> Recording -> Create JMeter will add the relevant elements to the test tree.

enter image description here

Configure your browser proxy

To use the JMeter Recorder, you need to configure your browser to send all the requests via proxy. Any browser can be used for these needs, although there might be differences between the locations of the browsers’ configurations, which are browser-specific and might vary according to OS.

  1. To configure your browser:

    Chrome: Menu button -> Settings -> Show advanced settings… -> Network -> Change proxy settings

    Safari: Preferences -> Advanced -> Proxies -> Change Settings...

    Firefox: Menu button -> Preferences -> Advanced -> Network -> Connection -> Settings..

  2. For example, you can use the localhost 127.0.0.1. Change the port to the port in the HTTP(S) Script Recorder.

enter image description here

If you have issues while completing this stage, check that you don’t have any 3rd party plugins that can manage your browser’s proxy settings. If you do, like Hola VPN for example, the proxy settings will be unavailable in your browser’s menu.

  1. Click on the ‘Start’ button, which is at the bottom of the “HTTP(S) Test Script Recorder page, and go through the web application workflow you want to test. When you go back to JMeter, you should see all the captured requests from your browser.