JavaScript libraries

Functions created in JavaScript libraries can be used in all User Path scripts. These libraries allow code sharing between several scripts. They also help reduce memory usage on the Load Generators. The code stored in the libraries is shared by the users while the code contained in scripts is loaded into memory for each Virtual User. It is recommended to use functions whose code is stored in a library.


Create a JavaScript library

A JavaScript library is identified by its name and library file. You can use an existing file, or create a new, empty file. Each library contains one or several JavaScript functions.

  1. Select the Edit > JS Libraries menu item.
  2. Click on New library.
  3. In the following wizard, enter the name of the library.
  4. Choose either to create a new library or use an existing file, whichever is appropriate.
  5. Confirm the choice to exit the wizard.
  6. Select the created library in the library list.
Edit a JavaScript library

Access the libraries through the Edit > JS Libraries menu item.

If the file has been edited using an external editor, it must be reloaded into the interface using the Reload button.

Use the Compile button to compile the JavaScript libraries prior to execution. Compiling will check the script syntax (missing parentheses...) but not its validity (call method names ...).