3

GUI mode is interesting. At this moment I create one component (i.e. assertion) and then copy and paste it on every place where it's needed. But if I change assertion in some place I must manually change all same assertions in all other places where its used.

UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116
Ivan Velichko
  • 6,348
  • 6
  • 44
  • 90

2 Answers2

6

Reusability in Jmeter can be done in 4 ways:

  • include controller when you want to reuse a subset of test (login, logout)
  • module controller to reuse controller in existing plan
  • user defined variables that you can reuse everwhere
  • xxx defaults for some samplers ( Ftp, Http...)

But in your particular case you can do it as below.

Define your expression as a var in User Defined Variable then use it in your assertions:

For sampler use Http Request Defaults to factor what is common between them.

Note that to find elements with same regexp expression yoy can use search feature which highlights results of search.

UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116
2

IMHO The cleanest way to reuse components is to use ModuleController with jMeter Plugins' ParametrizedController.

The ParametrizedController link above will explain you how it's done.

Marko Bonaci
  • 5,622
  • 2
  • 34
  • 55
  • ParameterizedController link is now http://jmeter-plugins.org/wiki/ParameterizedController/ – mmeyer Dec 19 '14 at 07:35