Scripts

Scripts form the backbone of your performance test. Your test definition can contain one or multiple scripts.

Create a script

A script is the recorded actions of a business process in your application. Your load test can contain one or more scripts. You can access downloads to supported script tools from the Home > Get tools pane.

The following table lists the tools you can use to create scripts for your load tests. For details on supported versions, see Version compatibility.

Script Tool Description  Supported Protocols Vuser Type
TruClient

TruClient is a tool for recording web-based applications as you navigate through your business process.

For details on supported browsers in TruClient, see Supported browsers in the TruClient Help Center.

Note: Scripts created with TruClient Firefox .xpi extension are no longer supported.

  • TruClient - Native Mobile
  • TruClient - Mobile Web

GUI Vuser

TruAPI
  • TruAPI is an innovative scripting tool based on node.js.
  • TruAPI enables you to create JavaScript-based Vuser scripts and provides an API for handling transactions, think time, logging, and HTTP handling.
  • TruAPI scripts can be packaged and uploaded to LoadRunner Cloud and added to a test definition.

For details on working with TruApi, see TruAPI.

  Web Vuser
DevWeb

DevWeb is a new protocol offering, focusing on the HTTP (transport) level. It provides a lightweight, scalable, cross-platform solution using a brand new JavaScript SDK and engine. For details on the DevWeb Protocol, see the LoadRunner Professional Help Center.

DevWeb Web Vuser
VuGen

 

VuGen is a tool to record web-based applications on the transport level.

For further details on protocols, see VuGen Protocols in the VuGen Help Center.

  • Web HTTP/HTML
  • Mobile Application - HTTP/HTML
  • Web Services
  • Flex

    Flex scripts can run on on-premises load generators only.

  • Java

    Java protocols are supported for cloud and Windows on-premises load generators only.

    The following Java protocols are supported:

    • Java Record Replay
    • Java Vuser
    • Java over HTTP
  • MQTT

Web Vuser

VuGen

Use VuGen to record scripts on supported Enterprise Resource Planning (ERP) protocols.

Note: SAP-GUI, Oracle NCA, and Oracle Web protocol scripts can run on on-premises load generators only.

  • SAP-GUI

  • SAP - Web
  • Oracle NCA

  • Oracle Web

  • Siebel Web

    Note:

    • Siebel Web is supported only on cloud and Windows on-premises load generators.
    • You must add the ssdtcorr.dll file to the script. For details, see Siebel Correlation in the VuGen Help Center.
ERP Vuser
VuGen

Use VuGen to record scripts on supported legacy protocols.

Legacy protocol scripts can run on on-premises load generators only.

  • .Net

  • Citrix ICA

Legacy Vuser
Apache JMeter

Apache JMeter is an open source performance testing tool.

Tip: We recommend using the latest supported version of JMeter to create your scripts. For details on supported versions, see Version compatibility.

  • Hits per second and Throughput graphs in test results are only available for JMeter scripts that use HTTP Request Sampler.
  • Upload a JMeter script to LoadRunner Cloud in .zip format.
  • Include only one .jmx file in the root folder of the .zip file.

    If the JMeter script has dependencies on third-party plugins, you can include them in the lib/ext sub folder of the .zip file.

    If the JMeter script has dependencies on external .jar files (for example, JDBC drivers), you can include them in the lib sub folder of the .zip file.

    Other dependent files, for example, a *.csv file for parametrization, and folders can be added into the .zip file.

  • If your JMeter script contains multiple ThreadGroups, only one will be enabled during a test run.
  • To report transaction data, use the Transaction Controller to enclose relevant test steps.

  • If you are running this script type with on-premises load generators, you will need to install the JDK (version 8 or later).
 

Dev Vuser

Gatling

Gatling is an open source performance testing tool.

  • LoadRunner Cloud supports Gatling scripts that use HTTP requests.
  • Upload a Gatling script to LoadRunner Cloud in .zip format.
  • If there are multiple Gatling scenarios in a simulation, only the first scenario will be executed.
  • If you are running this script type with on-premises load generators, you will need to install the JDK.

For details, see Gatling scripts in LoadRunner Cloud.

 

Dev Vuser

Selenium

Selenium is an open source performance testing tool.

  • LoadRunner Cloud supports Selenium scripts that use the JUnit testing framework (version 4.12) or Mocha (version 5.2.0).
  • You can only run Selenium scripts on cloud-based load generators and not on on-premises load generators.
  • Upload a Selenium script to LoadRunner Cloud in .zip format (for JUnit) or .tgz format (for Mocha).
  • Metrics for Throughput and Hits per Second are not supported.
  • Taking snapshots on error is not supported.

For details, see Selenium scripts in LoadRunner Cloud.

  GUI Vuser
UFT Developer

UFT Developer is a powerful and lightweight functional testing solution.

  • LoadRunner Cloud supports UFT Developer scripts that use the JUnit testing framework (version 4.12).
  • LoadRunner Cloud UFT Developer scripts support the Chrome 56 browser.
  • You can only run UFT Developer scripts on cloud-based load generators and not on on-premises load generators.
  • Upload a UFT Developer script to LoadRunner Cloud in .zip format.
  • Metrics for Throughput and Hits per Second are not supported.
  • Taking snapshots on error is not supported.

For details, see UFT Developer scripts in LoadRunner Cloud.

  GUI Vuser

Localized script support

LoadRunner Cloud supports scripts written in non-Latin alphabets. However, you still must use Latin characters for file and folder names.

For scripts developed prior to VuGen 12.53, do one of the following:

  • On a machine whose region locale is set to a non-Latin alphabet, open and save the script using VuGen 12.53.

  • Manually update the .usr file by adding the following setting to the General section:

    ScriptLocale=<language code>

    For details, see Language codes.

Zipped files

Upload to the repository scripts that have been manually zipped.

Back to top

Manage scripts in the repository

The cloud repository houses all the scripts that you attach to your load tests. The following table lists the actions available to manage your scripts in the repository.

Action How to
Upload
  1. Click Upload.
  2. Select a .zip file to upload to the cloud repository.

    The TruClient extension automatically saves the script as a .zip file.

    For VuGen scripts, select File > Manage Zip Files > Export to Zip File.

    Tip: Drag and drop script files to upload.

Reload

Click Reload to refresh a script in the cloud repository.

If you want to keep the script's current runtime settings and apply them to the reloaded script, select the Keep runtime settings check box. To include run logic in the retained settings, also select the Include Run Logic check box.

Note:

  • You can only keep runtime settings for scripts of the same type.
  • The option to keep runtime settings is not applicable for scripts loaded from a Git repository.
  • If you want to keep the Run Logic, it must be compatible in both the source and destination scripts. If it is not compatible, the Run Logic will be updated from the source (reloaded) script.

Examples:

Scenario 1

  • Source and destination scripts are of the same type and Keep runtime settings and Include Run Logic are both selected.
  • Nothing is changed in the destination script's runtime settings.

Scenario 2

  • Source and destination scripts are of the same type and Keep runtime settings and Include Run Logic are not selected.
  • All of the destination script's runtime settings are updated from the source script, except for the runtime settings mode (global or local).

Scenario 3

  • Source and destination scripts are of different types.
  • Keep runtime settings and Include Run Logic are ignored and all of the destination script's runtime settings are updated from the source script, except for the runtime settings mode (global or local).
Delete Click Delete to remove a script from the cloud repository.
Download Click Download to copy a script from the cloud repository to your local computer.
Runtime settings

Click Runtime Settings to view or edit a script's runtime settings.

For further details, see Runtime settings dialog box.

Note: When editing runtime settings in the Assets > Scripts page, the changes are saved as global. This means that the settings apply to the script in any load test in which it is included, provided that the script is set to global mode for that specific load test.

Copy runtime settings

Copy runtime settings from one script to another:

  1. Select a script with the runtime settings you want to copy.
  2. Click the Copy runtime settings button.
  3. Select the script or scripts to be updated.

  4. Click Apply to apply the settings to the selected scripts.

Note:

  • Only scripts recorded in VuGen have runtime settings.
  • You can only copy runtime settings between scripts of the same type.
  • Only settings configured directly in the Runtime Settings dialog box, and that are common to both the source and target scripts, are copied.
  • Run Logic runtime settings are not copied.
  • When copying runtime settings in the Assets > Scripts page, only global runtime settings are copied. This means that the settings apply to the script in any load test in which it is included, provided that the script is set to global mode for that specific load test.
Assign labels Assign a label to a script. For details, see Scripts below.
Keys Assign a script key to a DevWeb script. For details, see Assign a script key below.

Back to top

Manage scripts in your Git repository

You can connect to an existing Git script repository and add those scripts to your LoadRunner Cloud load tests.

For details, see Git integration.

Do the following to add or update scripts from your Git repository to LoadRunner Cloud:

Action How to
Access the Git repository

Click and select Upload from Git to open the Git repository dialog box.

Select an agent

From the drop-down menus, select the agent, repository, and branch that connect to the script repository you want to use.

For details on managing your Git agents, see Agents.

If you want all the scripts that are uploaded from the repository to be configured for auto sync, select the Auto Sync check box. You can also individually configure scripts for auto sync. For details, see Sync Git scripts .

Select a script

Select one or more scripts from the Git repository. Click Add.

Sync Git scripts

You can sync Git scripts both manually and automatically.

To sync Git scripts manually:

  1. Select .

  2. Select the scripts you want to sync.

  3. Click to sync your scripts with the Git repository.

Note: When you manually sync a Git script, runtime settings configured for the script in LoadRunner Cloud are not retained.

To sync Git scripts automatically:

Select the Auto Sync check box for the scripts you want to be synced automatically.

When a change to a script is made in the repository and the script is subsequently automatically updated in LoadRunner Cloud, a message is added in the notifications area in LoadRunner Cloud.

Note:

  • Automatic sync of Git scripts is supported for Git agent version 2019.12 or later.
  • When you automatically sync a Git script, runtime settings configured for the script in LoadRunner Cloud are retained.

Back to top

View script in an editor

You can view a script's code files in a read-only text editor.

To view the contents of a script:

  1. In the Scripts tab, select a script from the list.
  2. Click View script.
  3. In the left pane of the View script window, select the file you want to view.
  4. Click a thumbnail in the right pane to scroll to the desired section of the script.
  5. To close the view, click OK.

The script view:

  • Supports all scripts except for TruClient, Selenium, UFT Developer (LeanFT), and JMeter.
  • Shows scripts up to five levels in a folder structure.
  • May not display files that are humanly unreadable or exceedingly large.

Back to top

View script details

The center pane displays identifying script details including script name, description, and who created and last modified it.

Additional script information pane

This pane, located on the right, displays the following information:

Section Description
General script details Displays general information about the script, such as script type, by whom and when the script was created, and by whom and when the script was modified.
Git details

If the script was uploaded from a Git repository, displays general information about the relevant repository and branch.

Click Commit history to view details of the last 10 commits on the script.

Note:

  • The Commit history link is displayed only for scripts that were uploaded or synced with the LoadRunner Cloud Git agent version 3.7 or later.
  • The commit history description displays only the first 100 characters for each included commit.
Related tests Displays other load tests that contain this script.

Runtime settings dialog box

View or edit common runtime settings for the script.

Note: Only the runtime settings that are relevant to the selected script type are displayed and can be configured.

Setting Description
Additional Attributes Provide additional arguments for a Vuser script. Using this view, you can pass external parameters to prepared scripts.
Browser

Configure the browser, user agent, and proxy server connection settings for the script.

Browser Emulation Configure the user agent and simulate browser cache for browser related runtime settings.
Download Filters Enables you to set the download filters for a script.
HTTP Configure HTTP connection settings.
JMS Advanced Enables you to set the JMS advanced runtime settings for Web Services scripts. For more information, see JMSTransport Overview below.
Log Configure the amount and types of information that are recorded in the log.

Miscellaneous

 

Configure miscellaneous settings for:

  • Snapshot generation

    Note: Always option is not supported.

  • Action on error

  • Automatic transaction settings

  • VTS port access. Enable this option to access your VTS server through a query string. For details, see Enable port forwarding.

Mobile Device Enables you to change mobile device properties.
MQTT Enables you to change MQTT runtime settings.
Pacing

Control the time between iterations. The pace tells the Vuser how long to wait between iterations of your actions.

You can control pacing either from the Load test > Script tab or Runtime settings > Pacing view. To select which setting is applied during run time, toggle the Local pacing check box in the script's settings in the Load test > Script tab.

 

Preferences Enables you to set various internet-related runtime settings.
Proxy

Configure the proxy sever connection settings.

Note: Proxy settings are ignored by cloud-based load generators.

Replay Configure replay settings.
Run Logic

Enables you to set the run logic runtime settings for a script. You can:

  • add or remove actions (vuser_init, action, or vuser_end) and blocks in a block.
  • change the sequence order of actions and blocks in a block (move up or down).
  • configure the number of iterations a block is run.
  • configure the run logic for a block as:
    • Sequential. The actions and blocks in each iteration of the block are run sequentially.

    • Random. The actions and blocks in the block are run with a probability of a user-defined percentage. For example:
      • You configure Block0 as random.

      • Block0 contains Action1 and Block1.

      • You configure Action1 as 20% and Block1 as 80%.

      • During the total number of iterations, Action1 and Block1 will run with a probability of 20% and 80% respectively (and not exactly 2 and 8 times).

    The total percentage of all the children in a block must equal 100%.

Note: Run Logic settings are not copied when you copy runtime settings from one script to another.

SSL Configure SSL connection settings.
Think time Configure the think time settings, controlling the time that a script run waits between steps. These settings are designed to help you emulate a real user.

Back to top

View snapshots

Snapshots, a visual representation of each script step, are displayed in a carousel on the right hand side of the script page. Double click the thumbnail to see the images in an enlarged view.

Note: Snapshots are currently supported only for TruClient scripts.

Back to top

Assign labels

Use labels to help you organize scripts in your repository, or to organize your load tests in the Load Tests and Results pages. The labels you create are common to both scripts and load tests.

Labels can be nested in sub-categories:

Click to expand the Labels pane.

You can perform the following actions for labels:

Action How to

Create a label

 

  1. From the Labels pane, select to open the new label dialog box.
  2. Give the label a name.
  3. If desired, nest the label under another label.
  4. Click to select a label color.
Edit a label

From the Labels pane, highlight a label.

Click and select Edit.

Delete a label

From the Labels pane, highlight a label.

Click and select Remove.

Removing a label also removes any sub-labels.

Assign a color to the label

From the Labels pane, highlight a label.

Click and select Color.

Add a sub-label

From the Labels pane, highlight a label.

Click and select Add Sub-label.

Assign a label
  1. From the scripts or load tests grid, highlight one or more rows.
  2. Expand the drop down.
  3. Select the labels to assign to the selected scripts or load tests.

Use to search for a label name.

Filter by a label

Filter scripts or load tests by a specific label.

In the Labels pane, highlight the label to search for.

Use to search for a label name.

Back to top

Assign a script key

A script key contains an encryption key for an encrypted DevWeb script. By assigning a script key to a script, you can run the script without having to expose the encryption key within the script itself.

You create and manage script keys in Assets > Script Keys. For details, see Script keys. When assigning script keys, you can also create a new key by clicking Create a key.

To assign a script key to a DevWeb script, select the script and click Keys. Select the script key you want to assign and click OK. The name of the assigned script key appears in the right pane as part of the general script information.

Note:  

  • You can only assign a script key to a DevWeb script.
  • You can only assign one script key to a script.

To remove an assigned key, select the script, click Keys and do one of the following:

  • Deselect the script key you want to unassign and click OK.
  • Click Clear and then click OK. This unassigns all the keys that are listed.

Back to top

Assign a data file

A data file contains information used by scripts. By assigning a data file to multiple scripts you can manage the data in one location rather than having to update multiple scripts for each change.

You upload and manage data files in Assets > Data Files. For details, see Data files.

To assign a data file to a script, select the script and click Data files. Select the data file you want to assign and click OK.

Note: You can assign only one data file to a script.

To unassign a data file from a script, select the script and click Data files. Deselect the data file you want to unassign and click OK.

Back to top

Next steps: