Skip to content

lifecube/JMeter-Load-Javascript-Libraries-For-Future-Usage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JMeter-Load-Javascript-Libraries-For-Future-Usage

Sample for how to load javascript libraries in JMeter, and use them later.

This approche can not work with JSR223 Elements.

Usage:

  1. Load the utils.js at first by BSF Sampler

It require one parameter: jsPath in vars.

  1. From other BSF Sampler, it is require to load the utils from props.

    //it have to be retrieved everytime from new Sampler
    var utils = props.get('utils');
  2. load() js files and add the functions into current context

    //can load more than one file once.
    utils.load(['moment.min']);//or utils.load('moment.min');
  3. reload() put the functions previously loaded into current context

    utils.reload();

Check the example jmx file. Tested on JMeter 2.9

NOTE:

I put moment.js in the js folder, just for example.

About

Sample for how to load javascript libraries in JMeter, and use them later.

Resources

License

Stars

Watchers

Forks

Packages

No packages published