Resourceful Engineer

" Known is a drop, Unknown is an ocean"

Mercury LoadRunner


Mercury LoadRunner™ is the industry-standard performance testing product for predicting system behavior and performance. Using limited hardware resources, LoadRunner emulates hundreds or thousands of concurrent users to put the application through the rigors of real-life user loads. Your IT group can stress an application from end-to-end and measure the response times of key business processes. Simultaneously, LoadRunner collects system and component-level performance information through a comprehensive array of system monitors and diagnostics modules. These metrics are combined into a sophisticated analysis module that allows teams to drill down to isolate bottlenecks within the architecture.

LoadRunner supports the widest range of enterprise environments and is the only performance testing product to be customized and certified to work with ERP/CRM applications from PeopleSoft, Oracle, SAP, and Siebel.

The VuGen Script File Development Process

    These steps are part of an overall corporate Approach to Managing Performance
  1. Define the test project's objectives, environment, scripts, data, hardware, etc. The assumptions for the script should reference coding standards/conventions.
    Idea I code HTML to create a web page that I can link to in my status reports.

  2. List (in a table) for each business processes the manual actions needed to walk though the actual application steps needed to 1) capture each screen image for documentation, 2) assign a unique transaction name to each screen, and 3) note the technical component (URL or method and function) handling each step.

    Idea So that transaction names are listed in the sequence of manual steps, I assign transaction names such as "T00_Login","T01_Homepage" etc.).

    View captured screen I capture the image of each screen into an MS-Word file for documentation purpose.

    Idea As needed, I note for each screen/step its testability status (such as not available for use, script having errors, is being ignored, data parameterization, variations in values, etc.)

  3. Create a script folder. Idea I prefer not to use the default location, but to store all files associated with a script together in the same folder. Unfortunately, this means that if I switch between different tests, I have to remember to change the default settings every time.

     

  4. Use VuGen to generate a sequence of script code by Recording the application according to the sequence of screens and user steps specified in your business processes list. In the "Start Recording" dialog:

    • select application type "Win32 Application" to use the COM/DCOM protocol
    • select application type "Internet Application" to use the "Web(HTTP/HTML)" protocol.

  5. Edit the script based on the Ways to script list and follow script language rules.

    • Comment out cookie code (because they will be performed again when the script is run).

  6. Debug and Adjust script (for a single user) by running it within VuGen with Runtime Settings Logs set to display all messages:

    • Identify and fix script editing errors.
    • Determine timings
    • Set initial Runtime Settings Scenarios

  7. Run in Controller using full test Runtime Settings

Ways to Script

  • add transaction statements to obtain transaction timings for each screen in the GUI.
  • Add display values to aid debugging.
  • Add verification checkpoints to detect whether the intended text or image is displayed after each script action.
  • Parametize hard-coded URLs, user id, passwords, and other variable data by inserting in its place a new parameter such as a Date/Time stamp and entire files obtained dynamically so that the script can dynamically replace parameters to simulate use of different data during a run.
  • Add retry logic to handle forseeable errors.
  • Add if/else logic to check results and take appropriate action and exit the script when appropriate.
  • Add statements to capture data in one screen for use in another command. This is needed to prevent chronic "script timeout" errors and when working with web apps using Microsoft .NET web forms technology.
  • Add statements to manage time-out.
  • Calculate & subtract Wasted Time from transaction timers
  • Add Rendezvous points

Script Recording & Generation Basics

    Idea When you open VuGen for the first time, click the box on the lower left corner so that you can select existing scripts.

    Reminder The first step to creating a new script is to select single or multi-protocol.

    • Some protocols may not be available in multi-protocol mode.
    • You can rearrange actions only within the multi-protocol GUI.

    Java Before working with Java protocols, make sure you have the JDK in the PATH environment variable. Otherwise you'll get this message:

      Error: Failed to find javac.exe Java Compiler in Path and JDK installation folder in registry. [MsgId: MERR-22981]
      Error: Failed to get JRE version. Check that your PATH environment variable contains \bin directory. [MsgId: MERR-22986]

    When selecting a Java protocol:

    • You can only record if you select "RMI Java".
    • "Start Recording" icon/menu will be grayed out if you select "Java user".

    When you open a new script, the name of the script is, by default, noname1. The name of the next new script is automatically incremented to noname2, etc.

    Idea The default Working Directory for v7 scripts is C:\Program Files\Mercury Interactive\Mercury LoadRunner\bin\

    Idea But rather than starting from scratch, I prefer to open an existing script and "Save As" the new script name. This allows me to modify a script file that has features I know works.

    Idea Sooner or later, you're going to wish you had a prior version of a script you're working on. To make sure you have a version to fall back to, zip up the script folder immediately after you get a script to work.

    Idea I prefer recording into an action (such as one named "Recording") that I have deleted from the Runtime Settings' Logic section. After the default Action section is deleted, it still appears in the list at the top of the icon list, but is shown with a grayed out icon. New actions are inserted beneath it. I do this to avoid accidentally running recorded scripts before editing, which I've done too many times because new actions are automatically added to the Logic list in Runtime Settings.

    Idea Before recording, write down the manual actions. Give a unique identifier to each step.
    As you record, insert each identifier from your list after each action.

    Reminder Record several actions in sequence (rather recording one action, then stopping and starting with another action). This allows you to recognize sequence numbering (in applications such as PeopleSoft) that you need to correlate in your script.

    Idea Immediately after recording, copy the "Generation Log" to a text file in a different folder than the script you are working on. The next time you record, it will be wiped out. You'll need the file to see exactly what went to and back from the server.

    Reminder Every time a change is made in a script, that script needs to be recompiled.

courtesy : Mr.Wilsonmar

Create a Free Website