So after executing a test run, I have the Aggregate Report's table filled with the data of the test plan that just finished running. Now, when I execute the test plan again, the results are getting added to this data in the Aggregate Report's table, but I would like the table data to be cleaned up before starting to display the results for the current run. Any way to do this?
If you do not plan to re-run your test in future and would just like to convert 4 results files into a single "uber" results file you can use Merge Results tool which main use case is to compare results of different test runs, however you can use it to combine multiple results files into one, just use the same Prefix ...
In JMeter, we have different listeners to view the result of Test Plan, in which aggregate report is one of the listeners that are provided by the JMeter. The aggregate report is the same as the summary report except the aggregate listener provides some additional parameters such as Median.
The order of execution would be: Pre-Processor 1. Timer 1. Timer 2.
Jmeter does not have a flag to do this automatically.
Generally, you have to clear the results with CTRL+E (in windows) or from the file menu, under RUN > CLEAR or RUN > CLEAR ALL
You might be able to write a beanshell script to clear the results everytime you execute the script.
http://www.javadocexamples.com/java_examples/org/apache/jmeter/samplers/SampleListener/
Here is a Beanshell script that will clear the results everytime you execute it:
import org.apache.jmeter.gui.GuiPackage;
import org.apache.jmeter.gui.JMeterGUIComponent;
import org.apache.jmeter.gui.tree.JMeterTreeNode;
import org.apache.jmeter.samplers.Clearable;
log.info("Clearing All ...");
guiPackage = GuiPackage.getInstance();
guiPackage.getMainFrame().clearData();
for (JMeterTreeNode node : guiPackage.getTreeModel().getNodesOfType(Clearable.class)) {
JMeterGUIComponent guiComp = guiPackage.getGui(node.getTestElement());
if (guiComp instanceof Clearable){
Clearable item = (Clearable) guiComp;
try {
item.clearData();
} catch (Exception ex) {
log.error("Can't clear: "+node+" "+guiComp, ex);
}
}
}
To use this Beanshell script in your JMeter Script :
1) Select the root node of your JMeter Script, and, using the mouse menu, add a setup node :
Add / Threads (Users) / setup Thread Group
2) Select the newly created node, and using the mouse menu, add a script node :
Add / Samplers / Beanshell Sampler
3) Finally, copy and paste the above script into the Script window.
Note: Manual procedure to achieve this via GUI functions is given below.
The Clear
option is available under the Run
menu.
Function | Windows Keyboard Shortcut | macOS Keyboard Shortcut |
---|---|---|
Clear | CTRL+SHIFT+E | ⌘+SHIFT+E |
Clear All | CTRL+E | ⌘+E |
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With