Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 986 Bytes

File metadata and controls

35 lines (26 loc) · 986 Bytes

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.