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

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
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 a 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 JDK (recommended 64-bit OpenJDK 11).

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

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

Note: SAP-GUI 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
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

  • Windows Sockets

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

Back to top

Manage scripts

You manage your scripts in one of the following places:

  • Assets > Scripts tab

  • Load Tests > Scripts pane

Use the Assets area to manage scripts globally in the LoadRunner Cloud repository, and make them available to all tests in your project.

Use the Load Tests area to manage scripts for a specific test, without affecting the global script asset.

Back to top

Upload Silk Performer scripts

To use Silk Performer scripts in your load test, you need to upload them through the Silk Performer Workbench.

To upload Silk Performer scripts:

  1. In the Silk Performer Workbench window, select File > Upload Project to > LoadRunner Cloud.

  2. In the Login step, enter the tenant and login information.

  3. In the Project step, select the LoadRunner Cloud project into which to upload the script.

  4. In the User Types page, select the user types to upload. Click Finish.

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.

Note: For shared Git agents, if multiple users upload or synchronize scripts using the same agent simultaneously, the uploading or synchronizing time will increase.

Select an agent

From the dropdown 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: