Test Performance with Jmeter
- mohdmyyusuf
- Nov 11, 2021
- 2 min read
Updated: Nov 19, 2021
Execution order of jmeter elements:
If multiple elements are added to a Test Plan in Jmeter, the execution order will be as follows: config elements > pre-processors > timers > samplers > post processor > Assertions > Listeners
There are different components in Jmeter which are called Jmeter elements.
Samplers are different type of requests sent by thread groups. The user request could be an HTTP request, JDBC request or FTP request.
Listeners shows the results of the test execution. They can show the result in different formats like tree, table graph or log files.
Latency is the difference between the time when the request is sent to the server and response is returned back to client or response is started to be received.
Response time = Latency + request processing time
We can run jmeter in two ways:
The differences in different options in Jmeter are worth knowing to work on it efficiently.
Run and Run remotely:
When we run the script on the same machine use the option Run. When we run the script remotely, select the option Run remotely.
Stop and Shut down:
If stop option is selected, the execution is stopped immediately. If Shutdown is selected, it lets the current thread to complete first and it does not stop it incomplete.
Log viewer: go to options > Log viewer > Log level.
To run the jmeter in non GUI mode run the cmd as administrator and then change directory to "bin" of jmeter. Now type command:
jmeter -n -t testName.jmx -l <path to save the result>\filename.jtlThe .jtl file is saved to the location and it can be opened in excel. The report can be generated by uploading the script on Blazemeter site and run it there in simple steps as follows:
Create the account on Blazemeter.
Create the jmeter script using the jmeter.
Upload the .jmx file(jmeter script to blazemeter site).
Save it and run it.
User can save the
-------------------------------------------------------
To run the Jmeter in multiple slave machines some configurations are required to be done. Before doing that let's understand why we need it.
To integrate the selenium with Jmeter, follow the steps below:
Export the selenium code in jar file.
Copy the jar file and go to apache-jmeter > lib > junit
Paste the jar file here.
Now open jmeter and create a thread group.
Add a junit request instead of http sampler.
Click the checkbox "Search the junit 4 annotations" in Junit request window.
Select the class name and method name in the dropdowns.
Add listener etc and that's it.
It is not a good practice to run the script in by opening multiple instances of browsers, so we should use the concept of headless browser. We can use html-unit driver instead of any other
browsers.
Comments