質問

I have the JMeter code, (https://jmeter.apache.org/svnindex.html).

In JMeter we can add testelements by right clicking on test plan>add>.... I want to automate this adding of a testelement (eg: Regular expression extractor) to the testplan. Means, I have a button on my HTTP request form (or any testelement). Upon clicking the button a regular expression extractor should be added in the testplan tree as a child of the HTTP request. Could you please help me?

package org.apache.jmeter.extractor.gui.RegexExtractorGui is the class for regular expression extractor gui.

Thanks.

役に立ちましたか?

解決 2

I got the solution for my Question from AddToTree of org.apache.jmeter.gui.action package as guiPackage.getTreeModel().addComponent(testElement, parentNode);

Here, guiPackage is an instance of org.apache.jmeter.gui.GuiPackage class.

Testelement can be created using guiPackage.createTestElement(classname).

guiPackage.getCurrentNode() will provide currently selected node.

finally guiPackage.getTreeModel().addComponent(testElement, parentNode) will add the testelement as a child of parent node.

Thank u

他のヒント

To safe your time you can use JMeter template feature. You can create your own templates with combination of any JMeter elements. May be it's what you are looking for?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top