Scripts

Scripts contain the actions of a business process and 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 Support Matrix.

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
  • 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 - ERP

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

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

  • 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
Silk Performer

Use Silk Performer to create scripts that can run as GUI or Web Vusers.

  • Silk Web browser-driven, shown in LRC as SP Browser-driven.
  • Web low level (HTTP), shown in LRC as SP Web Basic
  • Web business transaction (HTML/HTTP), shown in LRC as SP Web Page-level
  • HTTP Live Streaming (HLS), shown in LRC as SP HLS
  • XML/SOAP, shown in LRC as SP Web Services
GUI Vuser:
SP Browser-driven

 

Web Vuser:
SP Web Basic, SP Web Page-level, SP HLS, and SP Web Services

VuGen - legacy

Use VuGen to record scripts on supported legacy protocols.

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

  • .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 Support Matrix.

  • 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 JMeter 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

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 Code Identifier Reference.

Zipped files

Upload to the repository scripts that have been manually zipped.

Back to top

Manage scripts

You manage your scripts from the Assets > Scripts tab. The Scripts tab shows all of the scripts that exist in the LoadRunner Cloud repository. You can attach any of these scripts to your load test, or upload new scripts.

The following table lists the available actions:

Action How to
Upload

You upload a script in the form of a .zip file. The TruClient extension automatically saves the script as a .zip file. For VuGen scripts, select File > Manage Zip Files > Export to Zip File.

To upload a script, do one of the following:

  • Click Upload and browse for the script's .zip file.
  • Drag and drop them into the Assets > Scripts page.

The following guidelines apply to the allowed number of scripts and their size:

  • The script size cannot exceed 200 MB.
  • The maximum number of scripts that can be added to a load test is 100 for trial versions and 500 for non-trial versions.
  • The maximum number of scripts that can be uploaded to a tenant is 500 for the trial versions and 30,000 for non-trial versions.
Reload

Click Reload to refresh a script in the LoadRunner Cloud repository.

  • Do not keep runtime settings. Instructs the reload not to keep the existing script's runtime settings. Instead, it uses the new script's runtime settings.

  • Keep runtime settings. Instructs the reload to keep the existing script's runtime settings and not use those included with the new script.

    • Include Run Logic. Retains the Run Logic customizations of the existing script. If you do not select this option, when you reload a new script, the Run Logic properties of the new script will be used.

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 retain the run logic, it must be compatible between the new and existing scripts. If it is not compatible, the run logic from the new script will be used.

Examples:

Scenario 1

  • The existing and new scripts are of the same type and Keep runtime settings and Include Run Logic are both selected. Result: All runtime settings are kept as they were in the existing script, including the runtime settings mode—global or local.

Scenario 2

  • The existing and new scripts are of the same type and Do not keep runtime settings is selected. Result: All runtime settings are updated from the new script. the run logic will be reset to the default value, local.

Scenario 3

  • The existing and new scripts are of different types. Result: The Do not keep runtime settings and Keep runtime settings are ignored and all runtime settings are reset to their defaults from the new script. The runtime settings mode will be reset to the default value, 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 Open the runtime settings.

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 Assign labels.
Keys Assign a script key to a DevWeb script. For details, see Assign a script key below.

Back to top

Add and manage scripts in a 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 LoadRunner Cloud 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 Show Git only.

  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 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 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.

Tip: To see a list and view the status of your uploads and syncs, click the Notification button in the top banner, to the left of the project name. The Notification pane provides a time stamp and other relevant information for each event. If you have new notifications, the Notification button indicates the number of unread items . To delete an upload notification, hover over it and click x.

Back to top

Edit and view scripts from within LoadRunner Cloud

You can edit or view the script's files in a text editor from within LoadRunner Cloud.

Caution:  

  • There is no option to revert to the former version of your script—version control is not supported.
  • If you modify transaction names, your changes will not be reflected in the load test's SLA page .
  • Syntax validation is not supported. We recommend that you validate your code in an external script editor.

The following guidelines apply to the editor and viewer:

  • Editing is supported for all script types with the exception of TruClient, Selenium JUnit, and JMeter.
  • .NET scripts can only be viewed—not edited.
  • The editor/viewer can show up to five levels in the script's folder structure.
  • The editor/viewer may not display files that are humanly unreadable or exceedingly large.
  • Changes to Git scripts will not be retained if you perform a sync.

Note: To allow script editing, open a support ticket and request to enable script editing for your tenant. If editing is not enabled, you will only be able to view the supported scripts.

To view and edit the contents of a script file:

  1. In the Load Tests tab, choose a test.
  2. Click to open the Scripts page.
  3. Select the checkbox of the script that you want to edit. You can only make one selection at a time.
  4. Click Edit.
  5. In the left pane of the Edit script window, select the script file you want to view or edit.
  6. Click a page thumbnail in the right pane to scroll to the section of the script that interests you.
  7. View or edit the script.

    Tip: Auto-completion is supported for DevWeb scripts.

  8. Click Save to save your changes. Your changes are saved globally—all tests that use this script will be affected. The Details pane shows the modification date and time.

Note: You can also edit script files from the Assets section. Go to Assets > Scripts, select the checkbox for a supported script, and click Edit.

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.

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. In the Labels pane, click Create label to open the New label dialog box.
  2. Give the label a name.
  3. Optionally, nest the label under another label.
  4. Click to select a label color.
Edit a label

From the Labels pane, highlight a label.

Click the vertical ellipsis and select Edit.

Delete a label

From the Labels pane, highlight a label.

Click the vertical ellipsis 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 the vertical ellipsis and select Color.

Add a sub-label

From the Labels pane, highlight a label.

Click the vertical ellipsis and select Add sub-label.

Assign a label
  1. In the Assets > Scripts grid, select the check box of the scripts you want to label. For Results or Load tests, select one item in the grid.
  2. Expand the Assign labels drop down.
  3. Select one or more labels to assign to the selected items.

Use the Search box to find a label name.

Filter by a label

You can filter scripts, load tests, and results by a specific label.

In the Labels pane, highlight the label or sub-label to search for.

Use the Search box to find 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.

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 can assign only one data file per script.

Before assigning data files to scripts, upload the files to LoadRunner Cloud from the Assets > Data Files tab. For details, see Data files.

To assign data files to scripts:

  1. Open the Scripts page from one of the following tabs:

    • Click Assets > Scripts.

    • Click Load Tests, select a load test, and click Scripts .

  1. Select a script and click the Data file button. The Assign a data file to scripts dialog box opens.

  2. Choose the data file to assign to the selected script and click OK.

  3. To remove a data file assignment, repeat step 2, and click Clear.

Back to top

Next steps: