How to generate test result log in JMeter?
JMeter is used as a performance testing tool for an application or a software system. It applies the virtual load and finds out the performance of the application by capturing the response time and other stats. These stats are captured in the log file called “JMeter Test Result Log File”.
Unlike other performance testing tool, JMeter does not create the test result log file implicitly. JMeter requires external commands to generate the result log. The command line option used for generating the result log file is -l (hyphen l). This command line option is embedded with the command to start the JMeter test as shown below:
jmeter -n -t <Jmeter script path> -l <test result log file path>
jmeter -n -t D:\Project\Scripts\TestCase01.jmx -l D:\Project\TestResultLog.jtl
./jmeter.sh -n -t “home/Project/Scripts/TestCase01_v0.1.jmx” -l “home/Project/TestResultLog.jtl“
Type of test result log file:
JMeter generates the log file in the following format:
Purpose of Test Result Log:
- Analysing the test result
- Get more detail on the error appeared during the test
- Generate the HTML report (Dashboard Report)
If the .jtl (or log) file does not exist then above command will automatically create a new .jtl file (named ‘TestResultLog’). If the file already exists then the result will be appended with the previous result, but no overwriting.