Download & Installation _ How to run the Jmeter

Jmeter Download & Installation
To install or rather setup JMeter on Windows, Linux and Mac. Since JMeter is Java based, so it runs all the operating systems that are Java compliant. Just make sure your machines has latest version of Java (JVM) installed.
For Windows Machines
> How to download Jmeter:
To download jmeter we have to access to the following url from web
step 1: Download the JMeter binary - "apache-jmeter-{version}.zip" from Binaries section
> How to Install Jmeter:
step 2:Unzip the JMeter binary to a directory where we want JMeter to be installed.
Step 3: Now we can launch JMeter by double clicking the jmeter.bat file inside the bin folder.
For linux Machines
> How to download Jmeter:
To download jmeter we have to access to the following url from web
srep 1: Download the JMeter binary – "apache-jmeter-{version}.tgz" from Binaries section
> How to Install Jmeter:
step 2:Extract the binary to a directory where we want JMeter to be installed.
Step 3Now we can launch JMeter by executing(double clicking) the jmeter.sh file inside the bin directory.
How to run jmeter :
Irrespective of machines we can run jmeter in two ways . Those are one is GUI mode and second one is Non-GUI mode.
For GUI mode just follow above steps to run jmeter.
For Non-GUI mode we have to run from command prompt (Windows) / Terminal (linux).
The following are the advantages if we run the jmeter in non-gui mode.
  1. Increasing threads (after certain limit) due to which JMeter crashes in the GUI mode.
  2. For heavy test scenarios (ex: shopping application: login-view product-add to cart-view bill-remove product-pay bill) JMeter consumes memory and CPU and it may affect your test results.
  3. To increase JMeter capabilities, i.e. to get more requests per second.
Running JMeter in command line mode: (windows)
Running JMeter using command line in non-GUI mode is very simple.
  1. Open command prompt
  2. Go into JMeter’s bin folder
  3. Enter following command, jmeter -n –t test.jmx -l testresults.jtl
JMeter has several parameters that can be used for running in the non-GUI mode.
-n: It specifies JMeter is to run in non-gui mode
-t: Name of JMX file that contains the Test Plan
-l: Name of JTL(JMeter text logs) file to log results
-j: Name of JMeter run log file
-R: list of remote servers
-H: proxy server hostname or ip address
-P: proxy server port
Once the test got completed to see the test results from “.jtl” file , follow the following steps.
  1. Open JMeter in GUI mode.
  2. Add any listener Eg. View Results Tree.
  3. Click Browse button of the file name field in listener.
  4. Open testresult.jtl file.
  5. You should be able to see the result in listener now.
Running JMeter in command line mode: (Linux)
Step 1: open the terminal and eneter the command
for understanding perpouse i am giving two ways of commands
simple command:
jmeter -n -J jmeter.save.saveservice.timestamp_format="yyyy/MM/dd HH:mm:ss" -t AFCS_UPDATED.jmx -l result.jtl
complicated command:
/home/madhusudhana/Desktop/apache-jmeter-5.1.1/bin/jmeter -n -Jjmeter.save.saveservice.timestamp_format="yyyy/MM/dd HH:mm:ss" -JAFCS.Threads=100 -JAFCS.RampUp=60 -JAFCS.Duration=900 -JLoop_Controller_login=1 -JLoop_Controller_update_ticket=1 -JLoop_Controller_update_location=1 -t /home/madhusudhana/Desktop/Updated_AFCS/AFCS_UPDATED.jmx -l Chatak_AFCS_23_MAY_Duration_15min_100TC_60R_1.jtl
Note:
  • To open the jmeter from terminal we have to enter the path where is the jmeter file is available: (the path)
/home/madhusudhana/Desktop/apache-jmeter-5.1.1/bin/jmeter
  • -n --------- indicates that executing in non gui mode
  • time stamp format (same for all the scripts)------------------- J jmeter.save. saveservice.timestamp_format="yyyy/MM/dd HH:mm:ss"
  • -t ------------------ we have to enter the name and path of jmeter jmx file (AFCS_UPDATED.jmx)
  • -l --------------------- we have to enter the name and path of .jtl file where jmeter need to save the jtl file.

No comments:

Post a Comment