pratik thorve
pratik thorve

Reputation: 77

Add Customer Fields to Jmeter HTML and CSV Report

I want to add extra fields to my Jmeter HTML and CSV. As below.

1 When i run my Jmeter Test Suite , i pass a paramter to the same which is the configuration on which my application is running. I store the paramter somewhere in Jmeter.

bat "C:\MSG-Team\apache-jmeter-5.1.1\bin\jmeter.bat -n -t C:\MSG-Team\Jenkins\Test_Set_Files\TestSet1.jmx -Congif=XYZ-l C:\MSG-Team\Jenkins\Post_Processing_CSV\TestSet1_ConfigXYZ_Seperate_Service_Mode.csv -e -o C:\MSG-Team\Jenkins\Results_Directory\HTMLReport"

2 Once the execution is done i have the CSV report generated with a extra column that will hold the value for config that i had earlier sent as input parameter while executing the test.

3 Now i execute different test set with different configs.

4 Now i merge all the CSV

5 Now i generate the HTML report where inside the Statistics part i want the column Config name to be included.

Any thoughts / guidance on how to achieve this.

I have already checked the reportgenerator.properties and user.properties for the same but still not luck. Any help for the same is appreciated.

Upvotes: 1

Views: 887

Answers (1)

mkane
mkane

Reputation: 920

I'm hoping I'm understanding correctly what you are attempting to do...

I would add a BeanShell PostProcessor to a sample and make sure that you can actually see the variable i.e.

import org.apache.jmeter.threads.JMeterContextService;

try {
String config= vars.get("yourconfigname");

}
catch (Throwable ex) {
    log.error("Error in Beanshell", ex);
    throw ex;
}

If you can see it then all you have to do is to add that variable to user.properties

i.e.

sample_variables=yourconfigname

You would then have to edit the XSL that is used to generate the report to query then render the "yourconfigname" variable..

Upvotes: 1

Related Questions