0
votes

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

1 Answers

1
votes

Your approach is not very good as it violates 2 major JMeter Best Practices:

  1. You will need a Listener in order to write down the results and using Listeners is a performance anti-pattern
  2. Since JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy language for scripting

So I would recommend:

  1. Run your JMeter test in non-GUI mode and generate dashboard after it
  2. Use your operating system date and time command to create the folder with the timestamp

    • Windows 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`