Table of Contents
- 1. Adding Blazemeter Plugin to Browser
- 2. Recording Script via BlazeMeter Plugin
- 3. Importing Script (.jmx file) into JMeter
- 4. Adding JMeter Listeners
- 5. Viewing Result Tree Listener
- 6. Running and Validating Our Script
Honestly speaking if you already have a mature or established process using ‘native’ JMeter from Apache, without any kind of wrappers utilities or third-party tools then this article is of little value to you.
However, there are many companies and/or projects out there who may employ some wrappers or third-party tools, plugins etc. around JMeter, in order to ease out their NFT process while addressing limitations of ‘native’ Apache JMeter. In this regard, there are a number of solutions and plugins available from Blazemeter.
If you don’t want to work natively with JMeter then one such solution from Blazemeter is the Chrome Plugin. The Chrome extension records all of the HTTP/S requests and can create a synced JMeter and Selenium scripts. Furthermore, If you are a registered or licensed user of Blazemeter then it automatically uploads it to BlazeMeter, where you can execute it with a single click.
In this case, there is no need to install JMeter nor Selenium to record or run your performance test, the Chrome extension will create the JMeter and Selenium scripts automatically. The extension will also allow you to debug and test your recorded Selenium session on your local Chrome browser.
However, in this article, we shall be only demonstrating a quick recording scenario using BlazeMeter chrome plugin.We’ll be doing a Login test on a website called demo.taotesting.com.
1. Adding Blazemeter Plugin to Browser
You will need to download and install the BlazeMeter plugin form the Chrome Web store.Simply add the plugin and you are good to go.
2. Recording Script via BlazeMeter Plugin
If you are new to BlazeMeter, you will need to Sign-up. If you are already registered, just Login
Step 1: Name your test.
Step 2: Click the Record button to begin recording the steps of the test.
Step 3: Go to the demo testing site.
Step 4: Enter the Login ID and Password provided therein.
Step 5: Click Log in and ensure that you have successfully logged in.
Step 6: Click “Stop”. BlazeMeter will begin to process your test.
Step 7: Download the .jmx file by clicking the Save Button. In the prompted screen, select “JMeter only” and the domain as taotesting.com. Now click “Save” and the .jmx file will be downloaded.
Now we can start our work with JMeter.
3. Importing Script (.jmx file) into JMeter
Let’s import the test that we just recorded.
Step 1: Click Open in the menu bar and open the downloaded.jmx file into JMeter and save it with your project name.
Step 2. Then you will see the imported components under your Test Plan. Under the Thread Group, you will find the Test scenarios.
The Login ID and Password that was used under the Test will be displayed
>> Test>>https://demo.taotesting.com/tao/Main/login.
4. Adding JMeter Listeners
Listeners are used to display test results in JMeter. They help to monitor the requests sent by JMeter and analyze responses from the server while testing. Time and capacity related information collected for requests and responses from JMeter and statistical information such as distribution and percentages are the main things that listeners deal with.
We have to add a Result Tree listener to view our results.
Right-click on your Test Plan (Testing 2 in my case) >>Add >>Listener >>View Result Tree and you can have the result tree pane.
5. Viewing Result Tree Listener
This listener displays the samplers generated by JMeter and their assertion results. This listener provides request parameters, response parameters, and the response data. It displays the results under the relevant tabs named Sampler Result, Request, and Response Data.
In the Sampler Result, tab you will find information about headers, response code, time-related information such as latency, cookies, error count, etc. The Request tab gives information about HTTP methods, Cookies added, the URL and about the JMeter Script added.
This Listener is able to render the information transmitted into simple formats such as text, HTML or XML. Also, the substrings are filtered by this listener, this helps to construct and validate some post processors. Apart from that, it can display the unsuccessful assertions and compare the actual and expected results. These are some valuable features of View Result Tree Listener.
6. Running and Validating Our Script
Let’s follow these steps to validate our test.
Step 1: Run the test by clicking Start in the menu bar. You will see the verified results in the Result Tree Listener.
Step 2: Check the validated Sampler result, Request, and Response data to see the sample, code verified results, HTML scripts, and Response Headers respectively.
Hint: Change the names of your HTTP Requests to identify them easily. A meaningful name can be provided instead of the HTTP address.
Apache JMeter with BlazeMeter is surely one of the top solutions if you are thinking of venturing with non-native JMeter territory. Even though JMeter has many built-in solutions and features, BlazeMeter is more useful because of the additional features it provides.
Its worth giving a shot, so try it out and see if it works for you. Cheers!