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.
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.
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:
The following guidelines apply to the allowed number of scripts and their size:
|
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:
Examples: Scenario 1
Scenario 2
Scenario 3
|
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:
Note:
|
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. |
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 |
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:
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:
|
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.
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:
- All test types are supported except for TruClient, Selenium JUnit, LeanFT, 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:
- In the Load Tests tab, choose a test.
- Click
to open the Scripts page.
- Select the checkbox of the script that you want to edit. You can only make one selection at a time.
- Click
Edit.
- In the left pane of the Edit script window, select the script file you want to view or edit.
- Click a page thumbnail in the right pane to scroll to the section of the script that interests you.
-
View or edit the script.
Tip: Auto-completion is supported for DevWeb scripts.
- 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.
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:
|
Related tests | Displays other load tests that contain this script. |
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:
|
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:
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. |

JMS is a J2EE standard for sending messages, either text or Java objects, between Java clients.
JMS implements Peer-to-Peer (also known as Point-to-Point) communication by defining a message queue as the target for a message. Multiple senders send messages to a message queue, and the receiver gets the message from the queue.
LoadRunner Cloud supports point-to-point communication by allowing you to send and receive JMS messages to and from a queue.
Before you can send messages over JMS transport, you need to configure the following settings that describe the transport. You configure these settings in the Runtime Settings > JMS Advanced view for a script.
Setting | Description |
---|---|
Use external VM | Enables you to select a different VM. If this option is not selected, Vusers use the JVM provided with LoadRunner Cloud. |
Classpath | Specifies the Java classpath (vendor implementation of JMS classes). |
Additional VM Parameters | Specifies extra parameters to send to the JVM, such as –Xms or –Xbootclasspath. |
JNDI initial context factory | The fully qualified class name of the factory class that will create an initial context. |
JNDI provider URL | The URL of the machine running the JNDI service. |
JMS connection factory | The JNDI name of the JMS connection factory. You can only specify one connection factory per script. |
JMS security principal | Identity of principal (e.g. the user) for the authentication scheme. |
JMS security credentials | Principal’s credentials for the authentication scheme. |
Number of JMS connections per process | The number of connections to create for each mdrv process. All Vusers sharing a connection will receive the same messages. Fewer connections gives better performance. Default=1, maximum=50 Vusers. Allowed values range is 1 – 50. |
Received message timeout options | Select an option: Infinite wait – wait as long as required for the message before continuing. No wait – do not wait for the message, and return control to the script immediately. If there is no message in the queue, the operation fails. Specify timeout – use defined value. If no message arrives by the timeout, the operation fails. |
User defined timeout | Specify the number of seconds to wait for the message before timing out. |
Automatically generate selector | Select the checkbox if you want LoadRunner Cloud to automatically generate a selector for the response message with the correlation ID of the request. |
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.
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
|
|
Edit a label |
From the Labels pane, highlight a label. Click the vertical ellipsis |
Delete a label |
From the Labels pane, highlight a label. Click the vertical ellipsis 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 |
Add a sub-label |
From the Labels pane, highlight a label. Click the vertical ellipsis |
Assign a label |
Use the Search box |
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 |
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.
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 per script.
- To unassign a data file from a script, select the script and click
Data files. In the Assign a data file to scripts dialog box, click Clear.
Next steps: