TransWikia.com

Add an "ultimate threadgroup " in jmeter via java code

Stack Overflow Asked by raji on November 27, 2021

I want to create and execute a JMeter JMX file using java code. The JMX file should contain an ultimate thread group. is it any way to achieve the same.

One Answer

It would be something like:

UltimateThreadGroup threadGroup = new UltimateThreadGroup();
threadGroup.setName("Ultimate Thread Group");
CollectionProperty ultimatethreadgroupdata = new CollectionProperty("ultimatethreadgroupdata", new ArrayList<>());
CollectionProperty schedule1 = new CollectionProperty("schedule1", new ArrayList<>());
Arrays.asList("100", "50", "20", "120", "40").forEach(schedule1::addItem);
ultimatethreadgroupdata.addProperty(schedule1);
threadGroup.setData(ultimatethreadgroupdata);

Just remember to:

  1. Add kg.apc.jmeter-plugins-casutg library along with dependencies to your project classpath, otherwise it won't compile
  2. Install Custom Thread Groups bundle using JMeter Plugins manager, otherwise you will not be able to run the script.

Answered by Dmitri T on November 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP