Test Script in JMeter

Posted By : Harshita Tiwari | 20-Sep-2020

testing

Loading...

To create a script in JMeter, we need to use a controller (Record controller) that records the manual process of any web application testing and converts it into the automation script. This script is basically generated in an XML file. This recording helps testers to record and run their activity against the test target. It is a Type of Automation Testing but for multiple users.

To Record a script in JMeter, you need to follow these steps:

  1. Create a Test Plan.
  2. Configure your browser to use the JMeter proxy.
  3. Record the test Activity.
  4. Run your Test Plan.
  5. Then Save your test results.

How To Configure Your Browser and Why?

The proxy server allows the JMeter to watch and record the user activity while they are browsing a web application in a normal browser.

Proxy is basically a component that inserts between users and remote servers. So anything between the remote server and user goes through the proxy when Jmeter acts like a proxy that records all your browser interactions.

These are the steps to configure browser:

  1. First, create a test plan & Add a Thread group in it.
  2. In the Thread, group Adds Logic Controller.
  3. And in the Logic Controller, you need to select the Recording Controller.
  4. Then Add Non-Test Elements in your test plan.

Select Test Plan→ Add→ Non-Test Elements→ HTTPs Script Recorder.

(the hierarchy looks like this)

  1. You can Add some Results elements who will help you to record your results.

Select Test script recorder→ Add→ select Listeners→ Add view results Tree/ Table.

  1. Now configure your Test Recorder screen. Add Port number in their field and rest leave as default.

  1. Go to the Firefox browser and open the browser’s preferences.
  2. In General, select Network settings.

  1. Select Manual proxy configurations. Enter the same port number which you have used in your Test script recorder. And click the ok button.

  1. Now go to your JMeter and click on the Start button which is showing on your Test script recorder.

  1. This will show a warning. Which means you need to load the Root CA certificate in your browser. Click on the Ok button.

  1. Now go to Firefox browser and open preferences. Select Privacy & Security.
  2. Select certificates then view certificates.

  1. Click on the Import certificate and then after import the certificates click on the ok button.
  2. Now go to the browser and enter your website link for which you want to record the script.

In the above image, you can see the automatic scripts are generated under the Record controller. As I previously mentioned this is the automatic script that is generated while you are performing the manual steps in your configured browser. The Jmeter created a proxy in our browser and the Record controller will change this recording into the script.

And by using the added Result listeners you can see the result for the created script.

We, at Oodles ERP, provide 360-degree ERP development services to address cross-industry enterprises requirements. Our custom ERP application development services include full-scale software testing to render seamless app performance across devices. We have experienced QA engineers that specialize in performing a variety of software testing techniques to detect bugs and software glitches.