1

A component can be added to a single sampler by attaching it as a child of the sampler. E.g.:

enter image description here

A component can also be added to all samplers within a thread group by attaching it as a child of the thread group. E.g.:

enter image description here

I've got a component that needs to be added to multiple selected samplers, but not all samplers. Currently what I'm doing is mass copy-and-paste duplication:

enter image description here

Though it works, it's a clear violation of DRY and gets extremely tedious for real scenarios. (When the component needs to be updated (e.g. changing the regex <input type="hidden" name="sesskey" value="(.*?)" to something else), I'd need to manually update it in x20 places.)

How can a single component be assigned to multiple selected samplers?

1

I understand your problem and pain area.

But, as far as I know, there is no automated way other than copy-paste, you have to copy paste the required elements in all the required samplers, but you can reduce this copy-paste effort.

First, add the required element to only one selected sampler as a child of that sampler (as required by you), then copy that element and select all the required samplers using Ctrl + Left Click and once this selection is done, Paste the copied element, it should be added as child to all the selected samplers in one go only, i.e. your repetition will be saved.

Or, if you are comfortable with the structure of the .jmx file, then open your script with the help of Notepad++ or EditPlus or some other editor, and then add the element in your script directly in the text file (this may again require copy-paste). But remember to take backup of your script first (if you are using this method), as this may corrupt your script (if any tag or statement is pasted wrongly).

Like every other tool JMeter too have certain limitation(s) and you can assume this as one of the Usability limitation of JMeter.

2
  • 1
    Isn't it possible for a JMeter plugin to solve this problem?
    – Pacerier
    Sep 28 '15 at 17:34
  • unfortunately note, JMeter plugins are there for providing extra Functional features for Recording, Result Analysis, Resource Monitoring etc. but not such plugin is there which suits your problem. jmeter-plugins.org
    – Dhiman
    Sep 28 '15 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.