Scripts

Scripts incorporate the actions of a business procedure and form the courage of your performance test. Your test definition can contain one or multiple scripts.

In this topic:

Back to height

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

Reload scripts

In the Assets > Script surface area, you lot tin reload scripts to brand sure that your test is using its latest version.

You can reload a script from the file system or from a Git repository. You tin can reload an existing script from Git, even if information technology was originally uploaded from the file system.

To reload a script from the file system, with another file on the file organization, click Reload. If a Git agent is connected to the project, aggrandize the Reload dropdown and click Reload.

To reload a script from a Git repository:

  1. Brand sure a valid Git agent is continued to the project. For details see Add and manage scripts in a Git repository.
  2. Aggrandize the Reload dropdown and click Reload from Git.
  3. In the Reload script from Git dialog box, select an amanuensis, repository and branch.
  4. Select the script you want to reload. But select one script.
  5. Select Auto sync to instruct LoadRunner Cloud to go along the script upward to date from the Git repository.
  6. Click Reload.

Manage runtime settings

After y'all click Reload in the previous section's Reload script from Git dialog box, the Reload script dialog box opens. To manage the runtime settings, select an option:

  • Practise not proceed runtime settings. Instructs the reload not to go along 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 non 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: Note:

  • You can only keep runtime settings for scripts of the aforementioned type.
  • The option to proceed runtime settings is non available for scripts uploaded from a Git repository.
  • If yous desire to retain the run logic, it must be uniform between the new and existing scripts. If it is not compatible, the run logic from the new script will be used.

Runtime setting scenarios

Scenario 1

  • The existing and new scripts are of the same type and Proceed runtime settings and Include Run Logic are both selected. Event: All runtime settings are kept equally 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 blazon and Practise not go on runtime settings is selected. Result: All runtime settings are updated from the new script. the run logic volition be reset to the default value, local.

Scenario 3

  • The existing and new scripts are of different types. Issue: The Practice 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 manner volition be reset to the default value, local.

Back to elevation

View script details

In the Script Details pane within the Avails > Script area, yous can learn more about the selected script. This expandable pane is located to the right of the grid. It displays additional information about the script and a list of tests and data files associated with the script.

Script Details pane

This Script Details pane, simply bachelor when a unmarried script s selected, displays the following data:

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, the pane displays full 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.seven or later.
  • The commit history clarification displays but the first 100 characters for each included commit.
Related tests tab Displays all load tests that apply this script.
Snapshots tab

Displays snapshots, a visual representation of each script step. Double-click the thumbnails to see the images in an enlarged view.

Note: Snapshots are currently supported merely for TruClient scripts.

Related data files tab Displays all information files used by this script.

Back to top

Upload Silk Performer scripts

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

To upload Silk Performer scripts:

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

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

  3. In the Project pace, select the LoadRunner Deject project into which to upload the script.

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

For details on working with Silk Performer, see the Silk Performer Assistance Center.

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

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

Select an agent

From the dropdown menus, select the amanuensis, repository, and branch that connect to the script repository you want to use.

For details on managing your Git agents, meet LoadRunner Deject agents.

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

Select a script

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

Sync Git scripts

Yous tin can sync Git scripts both manually and automatically.

To sync Git scripts manually:

  1. Select Show Git only.

  2. Select the scripts yous want to sync.

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

Annotation: 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 Car Sync checkbox 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: When you lot automatically sync a Git script, the runtime settings configured for the script in LoadRunner Cloud are retained.

Tip: To meet a list and view the status of your uploads and syncs, click the Notification button in the top banner. The Notification pane provides a fourth dimension stamp and other relevant data for each consequence. If you have new notifications, the Notification button indicates the number of unread items . To delete an upload notification, hover over it and click ten.

Back to top

Edit and view scripts from within LoadRunner Cloud

Y'all tin edit or view the script's files in a text editor from inside LoadRunner Deject.

Circumspection:

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

The post-obit guidelines employ 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 exist viewed—not edited.
  • The editor/viewer can show upwards to 5 levels in the script'due south folder structure.
  • The editor/viewer may not display files that are humanly unreadable or exceedingly big.
  • Changes to Git scripts will not exist retained if you perform a sync.

Notation: To permit script editing, open a back up ticket and request to enable script editing for your tenant. If editing is not enabled, y'all will only be able to view the supported scripts.

To view and edit the contents of a script:

  1. In the Load Tests tab, cull 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 choice 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 department of the script that interests you.
  7. View or edit the script.

    Tip: Automobile-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 exist affected. The Details pane shows the modification date and time.

Annotation: You can too edit script files from the Avails section. Get to Assets > Scripts, select the checkbox for a supported script, and click Edit.

Dorsum to elevation

Assign labels

Employ 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 lot can perform the post-obit actions for labels:

Activity How to

Create a label

  1. In the Labels pane, click Create label to open up the New label dialog box.
  2. Give the characterization a name.
  3. Optionally, nest the label nether another label.
  4. Click to select a characterization color.
Edit a characterization

From the Labels pane, highlight a characterization.

Click the vertical ellipsis and select Edit.

Delete a label

From the Labels pane, highlight a characterization.

Click the vertical ellipsis and select Remove.

Removing a label also removes any sub-labels.

Assign a color to the characterization

From the Labels pane, highlight a label.

Click the vertical ellipsis and select Colour.

Add a sub-label

From the Labels pane, highlight a label.

Click the vertical ellipsis and select Add together sub-characterization.

Assign a label
  1. In the Avails > Scripts filigree, select the check box of the scripts y'all want to label. For Results or Load tests, select one particular in the grid.
  2. Expand the Assign labels drib downwards.
  3. Select i or more labels to assign to the selected items.

Utilize the Search box to find a label name.

Filter past a characterization

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

In the Labels pane, highlight a label or sub-label to filter the displayed items.

Use the Search box to notice 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 central to a script, yous tin run the script without having to betrayal the encryption primal inside the script itself.

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

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

Note:

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

To remove an assigned key, select the script, click Keys and practise i of the following:

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

Back to elevation

Assign data files

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

You tin can assign multiple data files to a script. Salve the data files in zip format, equally described in Prepare data files.

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

To assign data files to scripts:

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

    • Click Assets > Scripts.

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

  1. Select a script and click the Data file push button. The Assign data file(s) to scripts dialog box opens. By default, you can assign up to five data files to a script.

  2. Select the information files to assign to the selected script and click OK.

  3. To remove a information file assignment, repeat step 2, and clear the checkbox for that information file.

Note: By default, the total number of the data files that can be assigned to a single script cannot exceed five, and the total size of the data files assigned to a single script cannot exceed 50 MB. If y'all demand to change the default settings, open a support ticket.

Back to top

See as well:

  • Data files
  • Define a load test