I want to create an HTML report automatically after running each test in JMeter, also I want to create a folder dynamically with the current timestamp as a folder name for placing the report on my local drive. So how can we do this operation using Bean Shell sampler in tear down thread group?
1 Answers
1
votes
Your approach is not very good as it violates 2 major JMeter Best Practices:
- You will need a Listener in order to write down the results and using Listeners is a performance anti-pattern
- Since JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy language for scripting
So I would recommend:
- Run your JMeter test in non-GUI mode and generate dashboard after it
Use your operating system
date
andtime
command to create the folder with the timestampWindows example:
jmeter -f -n -t test.jmx -l result.jtl -e -o results-%date:~10,4%-%date:~4,2%-%date:~7,2%
Linux example:
jmeter -f -n -t test.jmx -l result.jtl -e -o results-`date +%Y-%m-%d`