Add JMeter application to PATH variable
Windows machine
- Open the System Properties window and click the Environment Variables button.
- In the System variables section, locate the Path variable, select it, and click Edit.
- In the Edit Environment Variable window, click New and add the full path to the bin directory where JMeter is located (e.g., C:\apache-jmeter\bin).
Mac/Linux machine
Open a terminal window.
Edit your shell profile file (depending on the shell you're using, this could be .bashrc, .bash_profile, .zshrc, etc.).
For example, if you're using Bash, run:
nano ~/.bash_profile
If you're using Zsh, run:
nano ~/.zshrcAdd the following line to the end of the file, replacing the path with your JMeter bin directory:
export PATH=$PATH:/opt/apache-jmeter/bin
Save the file and exit
Increase Heap Size of JMeter Application
For windows -
Modify the below command the jmeter.bat file in "jmeter/bin" folder
Ex - set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m
For Mac/Linux -
Modify the below command the jmeter file in "jmeter/bin" folder
Ex -"${HEAP:="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m"}"
Running JMeter in non GUI mode
To run JMeter in non-GUI mode, execute the following command in the terminal:
jmeter -n -t <path_to_your_test_plan>.jmx -l <path_to_results>.jtl -e -o <path_to_report_output>
For example: jmeter -n -t jmetertestfile.jmx -l logging.jtl -e -o htmlreport
Create HTML report file in Non GUI mode using results file
To generate an HTML report from the results file, run the following command in the terminal:
jmeter -g <path_to_results>.jtl-o <path_to_report_output>
For example:
jmeter -g logging.jtl -o htmlreport
Create Aggregate report file in Non GUI mode
Install JMeter command line tool from URL - “https://jmeter-plugins.org/wiki/JMeterPluginsCMD/”
Use the below command to generate an aggregate report in csv using the below command.
JMeterPluginsCMD.bat --generate-csv test.csv --input-jtl results.jtl --plugin-type ResponseTimesOverTime
Comments
Post a Comment