1

I have a Beanshell Listener which has a certain code written to fetch some metrics during the execution of the script. I want this listener to be appended to every other new Jmeter script automatically when a user creates a script in Jmeter. Is this possible?

Example:

A user opens a new Jmeter script and by default, the Beanshell listener created earlier having the code should automatically be there in the script for the thread group rather than adding a new Beanshell listener and copy-pasting the code to this newly appended listener. Is this scenario possible? TIA.

Jmeter Version - 4.0

sdgd
  • 723
  • 1
  • 17
  • 38

2 Answers2

0

You can take a look into JMeter Templates and come up with your own Template having whatever Test Elements you want and encourage colleagues to use your template for creating the tests.


Be aware that starting from JMeter 3.1 it is strongly recommended to switch to JSR223 Test Elements and Groovy language so it is a good time to consider migration.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks. I don't see any option of creating a new template. It just shows the existing templates that can be used. – sdgd May 28 '18 at 17:22
0

You don't need to copy paste code, Just put the file name which contains the script in file name field (can use Browse)

Script file A file containing the BeanShell script to run. The file name is stored in the script variable FileName

Notice that you better move to JSR223 Listener according to JMeter's best practice:

Since JMeter 3.1, we advise switching from BeanShell to JSR223 Test Elements

Ori Marko
  • 56,308
  • 23
  • 131
  • 233