Manage scripts
Scripts are used in LoadRunner Enterprise to emulate real user activities on your application. This topic provides an overview of how to create scripts and upload them to LoadRunner Enterprise to run your performance tests.
Vuser scripts overview
When you run a performance test, virtual users (Vusers) access your application concurrently in order to put load on your server. The actual steps that the Vusers perform when accessing your application are represented in a Vuser script. Each Vuser performs the actions recorded in one Vuser script.
You design Vuser scripts to emulate typical end-user activities on your application. For example, if you are testing performance on a Web site, the Vuser script emulates a real user accessing URLs, clicking links, submitting forms, and so on. When you create a performance test, you distribute your Vuser scripts among your Vusers.
Example: In the case of testing a Web site, you can specify that a portion of the Vusers run a Vuser script that emulates real users accessing your home page, a portion run a script that performs a search query, and a portion emulate the completion of an order form.
Upload and run scripts or tests in LoadRunner Enterprise
You can use Micro Focus's Virtual User Generator (VuGen) to record Vuser scripts, and then upload and run them in LoadRunner Enterprise. For details, see, Upload and run VuGen scripts.
After you have uploaded a Vuser script to LoadRunner Enterprise, you can edit the script parameters from LoadRunner Enterprise. For details, see Upload and run VuGen scripts.
You can also upload tests or scripts created in the following recording applications:
JMeter |
For details, see Upload and run JMeter scripts. |
DevWeb |
For details, see Upload and run DevWeb scripts. |
UFT Developer |
For details, see Upload and run UFT Developer tests. |
NUnit |
For details, see Upload and run NUnit tests. |
JUnit, Selenium |
For details, see Upload and run JUnit or Selenium tests. |
Note: The file path inside a script folder must not exceed 260 characters.
Convert tests based on NUnit and JUnit to VuGen scripts
Before you can run tests based on NUnit and JUnit in LoadRunner Enterprise, you must convert them to VuGen scripts. To do so, you need to install the VuGen Script Converter and convert them to VuGen scripts.
-
Download the VuGen Script Converter.
The converter must be installed on a machine that has the same NUnit or JUnit Framework installed as the one used when creating the test.
-
From the LoadRunner Enterprise navigation toolbar, click and select Download Applications.
-
Select VuGen Script Converter and click Download.
-
Install the script converter and run VuGenScriptConverter.exe.
Note: VuGen Script Converter can be run from LoadRunner Enterprise host machine. To do so, select Start > All Programs > LoadRunner > Tools > VuGen Script Converter.
-
-
Convert the test to a VuGen script.
You can convert a test to a VuGen script using the script converter, or convert it automatically from a command prompt.
To convert a test to a VuGen script using the script converter-
Select the test and specify a location for saving the converted script.
-
Click Convert. The converted script is saved in ZIP format.
-
(For JUnit tests only) Before running the converted VuGen scripts, make sure to update the Runtime Settings > Java Environment Settings > Classpath of the Vuser group, with the JUnit path and the dependent jars. For more details on runtime settings, see Configure runtime settings.
To convert the test from a command prompt-
Open a command prompt, and navigate to the VuGen Script Converter folder.
-
Type
VugenScriptConverterCmd.exe
, followed by the desired arguments, where:-s
is the source path and file name.-o
is the output path.-silent
converts the script in silent mode (does not prompt for user input or open the folder to the created script).Example:
VugenScriptConverterCmd.exe -s:C:\Program Files\UnitTests\junuit.jar -o:\UnitOutputDir
-
Select the test and specify a location for saving the converted script. Click Convert. The converted script is saved in ZIP format.
-
Edit script parameters
This section describes how to edit parameters in a Vuser script from LoadRunner Enterprise.
Note: If you edit a parameter, the change will affect every performance test in the current project that uses the script.
To edit a parameter:
-
From the LoadRunner Enterprise title bar, select Test Management (under Testing), and click a script in the Test Management tree. The Preview tab opens. For user interface details, see Create and manage tests.
-
In the Preview tab, select an action and click the Edit Parameters button. Select the script parameters you want to edit and modify as required.
Action Description Add Row - Click Add Row.
- Click the row and enter a value.
- Repeat steps a. and b. until you have entered all the parameter values.
Add Column You can add multiple columns of data.
- Click Add Column.
- Double-click the column and enter a value.
- Repeat steps a. and b. until you have entered all the parameter values.
Note:
-
Only File and Table type parameters are supported.
-
The parameters table is limited to displaying a maximum of 1000 rows or columns, and a file size of 2 MB. If these limits are exceeded, you must use VuGen for editing the parameter file.
-
Parameters can take a while to open and edit if they have a large number of rows and columns (above 100).
-
Click Update to save your changes.
Supported environments
In addition to testing Web sites, LoadRunner Enterprise can be used to test performance of non-Web environments. For example, you can test Citrix, MQTT, or Oracle NCA applications. For details of supported protocols, see the Virtual User Generator Help Center.
See also: