How to add a script - LoadRunner

You can add a script to the Scenario Scripts list using the Add Script dialog box. Once you have added the script to the list, you can view the details of the script you selected, edit the script, enable/disable it, or change its runtime settings.

To add a script:

  1. Click the Add Script(s) button to the right of the Scenario Scripts window, or right-click within a column and select Add Script. The Add Script dialog box opens.
  2. To add a script

  3. Click Browse. The Open Test dialog box opens.
    Select the path and file name of the new script.
  4. Click Open to select the files. The Open Test dialog box closes, and the new script name appears in the Add Script dialog box.
  5. Click OK to close the Add Script dialog box and enter the new script information in the Scenario Scripts window.

Understanding the Add Script Dialog Box

The Add Script dialog box enables you to add scripts to your scenario.

Select Script: Displays the available scripts in the current directory.

  • Script Name: Click the script you want to add to your scenario. The script appears in the Script Name column.
  • Script Path:Displays the script directory’s path.
  • Browse: Select a script from a different directory. To select a VB Vuser script, browse to locate the .usr file.
  • Record: Opens the Virtual User Generator so that you can begin recording a script. For more information on recording scripts, see the Mercury Virtual User Generator User’s Guide.

Note: While a scenario is running, you can add Vuser scripts to the scenario and enable them. However, if you add a script after all the Vusers in the scenario have been ramped up, the new script will not run in the scenario.

Viewing Script Information

Once you have added a script to the list, you can view the details of the script you selected, edit the script, enable/disable it, or change its run-time settings.

To view script details:

  1. Select the script and click the Details button to the right of the Scenario Scripts window, or right-click the script and select Details. The Script Information dialog box opens, displaying the Path, Name, and Type of the script you selected.
  2. To view script details

  3. Click Run-Time Settings to set the script’s run-time settings (optional), which allows you to customize the way the Controller executes a Vuser script. The Run-Time Settings dialog box opens, displaying the settings you previously set using VuGen.
    Note: If you modify the run-time settings from the Controller, LoadRunner runs the script using the modified settings. To restore the initial settings, click Refresh and selectRun-Time Settings.
  4. To edit the script, click View Script. The script generation tool, VuGen, opens. For more information on editing scripts, see the Mercury Virtual User Generator User’s Guide.
  5. Click More to expand the Script Information dialog box and view additional script information.
  6. Viewing-Script-Information

  7. In the Command Line box, type any command line options to use when running the script. For example: -x value -y value. For information about passing command line argument values to a script, refer to the Mercury Virtual User Generator User’s Guide.
  8. To see the rendezvous points included in the selected script, click the Rendezvous tab.
  9. To see the list of Vusers associated with the selected script, click the Vusers tab.
  10. To see the list of files used by the script, click the Files tab. By default this list shows all files in the script’s directory (only after your script has been added to the script list). These files include the configuration settings file, the init, run, and end portions of the script, the parameterization definitions file, and the .usr file. To add a file to the list, click Add and add the file name. Note that you can delete the files that you add, but not the other files listed.
  11. Click OK to close the Script Information dialog box.

To delete a script:

Select the script and click the Remove Scriptbutton to the right of the Scenario Scripts window, or right-click the script and selectRemove Script.

To disable a script

Click the box to the left of the Vuser script name. The color of the script entry changes to gray, indicating that the script will not take part in the scenario. To re-enable the Vuser script, click the same box again.

Understanding the Script Information Dialog Box

Lets you view the details of a selected script and modify its settings.

Script: Displays details of the selected script.

  • Name: Displays the name of the selected script. To modify the name, type the modified name in the Name box.
  • Path: Displays the script directory’s path.
  • Type: Displays the type of the selected script.
  • View Script: Opens the Virtual User Generator, so that you can edit the script. For more information on editing scripts, see the Mercury Virtual User Generator User’s Guide.
  • Run-Time Settings: Opens the Run-Time Settings dialog box, enabling you to edit the script run-time settings you previously set using VuGen. For information on the run-time settings, see the VuGen Help.
    Refresh: Click this button and select Script to update the script details in the scenario, if you make any changes to a script while the Controller is running. Select Run-Time Settings to restore the initial run-time settings, if you modify the run-time settings from the Controller.

More/Less: Reveals/hides the following:

  • Command Line: Type any command line options to use when running the script—for example: -x value -y value. For information about passing command line argument values to a script, refer to the Mercury Virtual User Generator User’s Guide.
  • Rendezvous: Displays the rendezvous points defined for the selected script.
  • Vusers: Displays all Vusers associated with the selected script.
  • Files: Displays all files used by the script. To exclude a file from the list, select the check box adjacent to it. To add a file to the list, click Add.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

LoadRunner Topics