JMeter Plugin configuration in .JMX file

139 views
Skip to first unread message

yoav...@gmail.com

unread,
Aug 10, 2016, 9:54:00 AM8/10/16
to jmeter-plugins
When adding JMeter Plugin - Example: jp@gc - Active Threads over time (or any other one):Test Plan -> Add -> Listener -> jp@gc -> click on UI -> following XML is added to .jmx file:

    <kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ThreadsStateOverTimeGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="jp@gc - Active Threads Over Time" enabled="true">
         ..
    </kg.apc.jmeter.vizualizers.CorrectedResultCollector>

I am trying to add similar part (xml) to .jmx file without opening JMeter GUI (through Java code) - What is the method (Backend) that modifies the .jmx file? 

Thanks!

Andrey Pokhilko

unread,
Aug 10, 2016, 10:50:49 AM8/10/16
to jmeter-...@googlegroups.com

Hi,

It's not as simple. JMeter has in-memory test tree which it dumps into XML files. So it's not pieces of XML added into file, but whole file is written at once.

Andrey Pokhilko

--
You received this message because you are subscribed to the Google Groups "jmeter-plugins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jmeter-plugin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yoav Agami

unread,
Aug 10, 2016, 11:08:38 AM8/10/16
to jmeter-...@googlegroups.com
I see. If I will take the following code, that invokes an existing JMX test:

        JMeterUtils.setJMeterHome(JMeterHome);
        HashTree testPlanTree = SaveService.loadTree(jmxFile);
        ** Do What GUI does when clicked on add jp@gc **
        ** SAVE JMX / reload JMX**
        jmeter.configure(testPlanTree);
        jmeter.run();

Is this something that is possible?
Thanks!


To unsubscribe from this group and stop receiving emails from it, send an email to jmeter-plugins+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "jmeter-plugins" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jmeter-plugins/DBJ21rArYSw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jmeter-plugins+unsubscribe@googlegroups.com.

Andrey Pokhilko

unread,
Aug 10, 2016, 11:31:20 AM8/10/16
to jmeter-...@googlegroups.com

Yes, it is possible.

Andrey Pokhilko

To unsubscribe from this group and stop receiving emails from it, send an email to jmeter-plugin...@googlegroups.com.

yoav...@gmail.com

unread,
Aug 10, 2016, 1:39:23 PM8/10/16
to jmeter-plugins
Thanks, I'll try this approach. Are you familiar with the JMeter/Plugin method/area that I should look for?
"On Click" after adding a Plugin, "Save test" - what code is called?
Thanks!
To unsubscribe from this group and stop receiving emails from it, send an email to jmeter-plugin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "jmeter-plugins" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jmeter-plugins/DBJ21rArYSw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jmeter-plugin...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Andrey Pokhilko

unread,
Aug 10, 2016, 1:42:05 PM8/10/16
to jmeter-...@googlegroups.com

Just check out JMeter source code and search there. I don't have it on top of my head...

Andrey Pokhilko

Reply all
Reply to author
Forward
0 new messages