Run TruWeb scripts

You can run a TruWeb script using the TruWeb executable, or in LoadRunner, Performance Center, or StormRunner Load.

TruWeb executable

To run a TruWeb script, you can use one of the following execution modes with the mode command line argument:

Run mode Description
single

Runs either one or multiple iterations for a single Vuser, regardless of the supplied scenario.yml file.

The following flags can be used:

  • iterations. The number of iterations that will be executed for a single Vuser. (Default = one iteration)
  • inspect. Enables the user to debug the script in Chrome DevTools (chrome://inspect/#devices).

Note: Multiple iterations are supported starting from version 2019.5.4 In earlier versions, you can run only a single iteration for a single Vuser.

load

Runs the script, using the scenario settings defined in the script's scenario.yml file to schedule the Vusers. For more information, see scenario.yml.

If the command does not include the execution mode, single mode is used by default.

After the flags, define the script directory. This directory must contain a main.js file and a scenario.yml file, and optionally an rts.yml file.

Example: Load mode. The following commands execute the script that resides in C:/ScriptDirectory, using the scenario defined in the scenario.yml file.

Windows

TruWeb -mode=load C:\ScriptDirectory

Linux/MacOS

TruWeb -mode=load ~/ScriptDirectory

 

Example: Single mode. The following commands execute one/multiple iterations of the script that resides in C:/ScriptDirectory. The scenario defined in the scenario.yml file is ignored.

Windows

TruWeb C:\ScriptDirectory

TruWeb -iterations=3 C:\ScriptDirectory

Linux/MacOS

TruWeb ~/ScriptFolder

TruWeb -iterations=3 ~/ScriptDirectory

Viewing test logs and results

  • Test run logs per Vuser are saved to ..\<Script folder>\results\logs. The log filename contains the Vuser ID.

    The log files are generated according to the vuserLogger settings in the script's rts.yml file.

  • Raw data is saved to a SQLite database file, truWebDB.db, in ..\<Script Directory>\results\.

    Note: If you use DB Browser for SQLite to view the raw data (recommended), make sure to close the file before running another test. If left open, DB Browser may lock the database file for write access.

Back to top

Database tables

When you run your TruWeb script in standalone mode, the raw data generated is saved to a SQLite database file, in ..\<Script Directory>\results\truWebDB.db.

The database creates the following tables for the script run:

Table Description
ActiveVusers

Contains a count of total running Vusers executing code within iterations. The number decreases when Vusers are waiting between iterations (pacing), and increases again when they enter the next iteration.

An entry is added to the table every time the total number changes.

AtomicTransaction

Note: Starting from version 2019.5.4, this database table is no longer available.

Contains time measurements per request/response pair (URL).

This data is not reported by default, due to the performance override. To active it, in the runtime settings file (rts.yml), under the httpConnection section, change reportAtomicTransactions to true.

BytesSent Contains the amount of bytes sent to the server (upload) per request, per Vuser.
Connections
(Supported from version 2018.11.4)
Contains for each Vuser information about opened and closed connections (state connect or shutdown).
CustomDataPoints

Contains values for user-defined data points, reported through load.utils.reportDataPoint API, per Vuser.

Hits Contains information about each request, including HTTP status code, per Vuser.
RunningVusers

Contains a cumulative count of running Vusers. An entry is added to the table every time the total number changes.

Throughput

Contains the amount of bytes received from the server (download) per response, per Vuser.

Transactions

Contains information on status and duration for each transaction reported, per Vuser.

WebSocketDataReceived

(Supported from version 2019.2.4)

Contains the amount of bytes for each received message, per Vuser.
WebSocketDataSent

(Supported from version 2019.2.4)

Contains the amount of bytes for each sent message, per Vuser.
WebSocketMessages

(Supported from version 2019.2.4)

Contains the amount of sent (SendMessage type) and received (onMessage type) messages.

Back to top

External tools and IDEs

You can run your TruWeb script from the TruWeb plugin within your scripting tool.

Example: JetBrains WebStorm (IntelliJ)

Select Tools > External Tools > Run TruWeb.

The results are displayed in the bottom panel. To run the script again, click the green Run button.

Example: Atom.io

To run one iteration of the script with one user, select TruWeb > Run single user.

To run a scenario with the script, select TruWeb > Run scenario. TruWeb runs the script using the scenario defined in the scenario.yml file.

TruWeb in Micro Focus testing tools

You can run a TruWeb script using LoadRunner, Performance Center, or StormRunner Load (see supported versions). Multiple TruWeb scripts can be run in parallel on one load generator.

To run a TruWeb script in your Micro Focus testing tool:

  1. Prerequisite for LoadRunner/Performance Center: If your script was created in a tool other than VuGen, import the script into VuGen:

    1. In VuGen, select File > Open > Import TruWeb Script.
    2. Browse to your script's main.js file and click Open.
    3. Enter a name for your script, and the location where you want to save the imported script.
    4. Click Import.
  2. In your testing tool, run your script as you would any other script. For more information, see the relevant Help Center for your testing tool.

See also: