How I may help
Facebook Follow me on TwitterLinkedIn Profile
Email me!

Reload this page LoadRunner Scenario Run Monitoring with AutoIt

Here are detailed yet concise tips and tricks for configuring LoadRunner Scenarios to monitor load and stress performance tests using AutoIt. This is a companion to pages on Vu Scripting, performance monitoring, performance tuning, and reporting.

 

Topics this page:

  • Overwhelming?
  • Run-time Metrics
  • Overlays
  • Duplicates
  • Scenario Setup Steps
  • AutoIt
  • Pop-Ups
  • AutoIt Quarks
  • Next

     

    Site Map List all pages on this site 
    About this site About this site 
    Go to first topic Go to Bottom of this page


    Set screen Metrics Overwhelming?

      The dozens of metrics available from LoadRunner can be overwhelming.

      So the task of setting up LoadRunner metrics for viewing during runs is more an art than a science.

      The LoadRunner Controller Run-time metrics viewer only allows a maximum of 16 graphs to be displayed. But labeling imposed by LoadRunner on each metric display makes the data part of the display unusable.

      Also, early versions of LoadRunner do not restore all the settings which it should remember when a saved Scenario is retrieved. Every time the LoadRunner Controller is closed down and restarted, one has to setup all the metrics display settings again.

      LoadRunner operators usually have precious little time on servers and cannot afford the risk and the time it takes to properly setup scenarios.

      This is why I sought out a quick and repeatable way of setting up run-time metric displays. What I am presenting in this page.

     


    Go to Top of this page.
    Next topic this page

    Set screen Run-Time Metrics Graphs

      It is a testament to the flexibility of the LoadRunner product that each shop usually has settled its own set of metrics to display during runs. The default metrics are:


    Go to Top of this page.
    Next topic this page

      1,1
      Response Time
      2,1
      Total Trans/Sec
      3,1
      Throughput
      [Data/Sec]
      4,1
      Running Vusers
      1,2
      Network Delay Time
      2,2
      Hits/Sec
      3,2
      Connections/Sec
      4,2
      Errors/Sec
      1,3
      Win.Health
      2,3
      Win.%Utilization
      3,3
      Win.Throughput
      4,3
      Win.Queues/Errors
      1,4
      Unix.Health
      2,4
      Unix.%Utilization
      3,4
      Unix.Throughput
      4,4
      Unix.Queues/Errors
      I position graphs so that each metric is close to other similar metrics:

    • Running Vusers is on the right, below the counts.
    • I generally use 16 graphs
    • When testing without metrics about the servers under test, I use the top two rows to display metrics that LoadRunner maintains at the top.
    • Windows metrics are in the third row to monitor the load controller and load generators.
    • If Windows servers are under test, I add their metrics to the same graphs I use to monitor the load controller and load generators.
    • When testing a Unix environment, I use the 4th row.

    Go to Top of this page.
    Next topic this page

    Set screen Scenario Setup Steps

      Right-click on a graph for the context menu shown to the right/below. The pop-up is positioned below the cursor unless the cursor is so close to the bottom of the screen that the pop-up needs to be positioned above the cursor. So items within such context menus which can be anywhere is simpler and more reliably selected by a keypress send command rather than with a calculated mouse position.

      • E for Rename
      • A for Add measurments, which only appears for System Resource Graphs such as Windows Perfmon.
      • Blah. I wish that LoadRunner would underline these letters in menu choices.

      Here are the steps I go through to setup a Scenario from scratch (which the AutoIt script file lr91.8col.start.au3 automates):

      1. Right-click on a monitor and select "View Graphs", Customer Number..., 8.
      2. Close all graphs.
      3. .

      The monitors shown is limited to licensing restrictions. A separate license is required for each monitor.

      The online.pdf file describes each metric.

      In Menu > Scenarios, you can "Save Load Generator List as Default" and "Load Default Load Generator List".




    Go to Top of this page.
    Next topic this page

    Set screen Overlays

      I prefer to overlay each graph with the number of Running Vusers so it remains visible when I zoom in on a particular graph.

      Whenever an overlay is applied to a LoadRunner metric graph, LoadRunner creates a new metric graph which needs to be closed. The overlaid graph is then listed in the Merged Graphs within the Available Graphs list. The new graphic is created in this "fan-out" sequence when 8 graphs are displayed:

        2,1 - 1,2 - 2,2 - 3,1 - 4,1 - 3,2 - 4,2

      Whenever a duplicate is applied to a LoadRunner metric graph, LoadRunner places the new graph on an empty metric widow.

      This is why a metric that is duplicated or overlaid is added from metric window position 1,1 at the upper left corner.

      The metric in position 1,1 is populated last (if you're making duplicates and overlays).




    Go to Top of this page.
    Next topic this page

    Set screen Duplicates for System Resource Graphs

      The System Resource Graph Windows Resources provide a link to all counters of Microsoft's Perfmon
      This is the same for SiteScope and UNIX Resources.

      Whenever possible I arrange metrics from several subystems/components into by category of data:

      • Percentage Utilization
      • Per second Throughput measures
      • Queues, locks, and other counters that ideally should be zero
      • Counts of various other indicators of health

      These different categories are achieved in LoadRunner's run-time metrics graphcs by duplicating each System Resource Graph into the categories listed above.

      Duplicates are displayed under System Resource Graphs within the Available Graphs list.

      Blah. I wish that LoadRunner developers would add to the two Add and Delete buttons a hotkey (hinted by underlines).

    Set screen Keystroke Automation Scripting Options

      There are several options for "server automation". But automatically replaying keystrokes such as needed for unattended installation may not be part of the capabilities.

      On the Windows platform, Microsoft has been improving PowerShell since 2006 to add features to the .bat files available since the first versions of the Windows operating system. Powershell now includes object-oriented features when Linux shell scripts are still working with only text.

      Its object orientation means that it can automate handling of objects from Microsoft Excel, Word, etc. That's somethine no other scripting shell offers.

      See https://developer.rackspace.com/blog/powershell-101-from-a-linux-guy/

      But there is still one workhorse that refuses to die:

      1. Autohotkey is used to create hotkeys (such as my Freeze all LoadRunner run-time graphs so the part relevant to the test doesn't scroll off the screen after a run).
      2. AutoIt is a free utility that has been around since the previous century. Its scripts uses VB syntax to automatically replay keystrokes such as needed for unattended installation. There is a large set of features, include COM integration with PowerShell.

    Set screen AutoIt Keystroke Automation Scripts

    Set screen My AutoIt Script

      My script is coded using functions. Calls to functions are at the top of the file. Generic functions for use by any script are at the bottom. Functions specific to LoadRunner are in the middle.

      TODO: I would like to add code to update a file after each step. The script will then only execute steps that have not been completed.

      At the beginning of my script, the first call is to list information about the script and its environment.

      code was added to determine whether LoadRuner is running and to shut it down if it is. A sleep() function is used to avoid the "The controller is already open on this machine" error message issued by LoadRunner.

      Functions return -1 on failure.

    Set screen Pop-Up Positioning

      Pop-up dialogs are especially challenging because they are positioned at different coordinates depending on the size of the screen (1024x768, 1920, etc.).

      This challenge is similar to scripting Citrix RTE using LoadRunner.

      This is why the preferred way to control the application is to send keyboard activity rather than using the mouse.

      When a mouse cannot be avoided, the solution is to define the anchor position of each dialog

        $lr_popup_horiz_start_pos = 351
        $lr_popup_verti_start_pos = 243

        These variables define the upper left corner of each pop-up dialog.

      Specific controls on that dialog is an offset from that anchor point.

      AutoIt records the position of controls from the anchor point of the pop-up (not from the 0,0 point of the entire screen).

    Set screen LoadRunner Work-around

      When AutoIt does not recognize an object, it freezes.

      Keep these LoadRunner behaviors (gotchas) in mind:

        LoadRunner does not allow you to open a graph that is already shown. If you do that, LoadRunner puts the focus on that existing graph, which can be behind the "Open a New Graph" pop-up. This means that follow-on AutoIt actions will not be performed on the pop-up screen. And if the script continues, it may think that the new graph is created in a new location rather than in the existing location.

      I was successful working around some of the non-standard LoadRunner features.

        I wrote AutoIt function lr_metric_item_add() with a "clear" flag as one of its parameters. This design violates the ideal of clearing being performed by another function call. But if all items are cleared from within Windows Resources, the next time in LoadRunner Controller presents the default items, not an empty list.

      Blah. I have not been able to figure out how to get AutoIt to control several LoadRunner pop-up screens: Overlay Graphs, Load Generators.

    Set screen AutoIt Quarks and Tricks

      To save me from needing to change parameters in the script, a search through the AutoIt forum yielded a function to retrieve from the Windows operating system the height and width of the application screen.

      The HotKeySet() function was added to PAUSE the script (which should have been built into the script by default) and SCROLL LOCK to freeze all LoadRunner metrics graphs.

      To pause at strategic points during the script, I add msgbox() functions. To disable the function, I put a semicolon in front of the function (;msgbox()) so that I can search for active msgbox functions in the script by searching for a tab character in front of msgbox().

      I'll put these generic functions into a library for use by other scripts. Scripts from others, such as this script to install Microsoft SQL 2000 Eval. Version use libraries such as:

      • #include <GUIConstants.su3>
      • #include <IE.su3>
      • #include <Misc.su3>

      Blah. The script that AutoIt recording generates creates cursor positions rather than object names for human consumption.

      So hand-coding is needed to define commands to recognize the state of a checkbox and sets it to the desired value:

      ; to check   (ADD) if previously unchecked:
      ControlSend("Open a New Graph", "", "TCheckBox1","{NUMPADADD}")
      ; to UnCheck (SUBtract) if previously checked:
      ControlSend("Open a New Graph", "", "TCheckBox1","{NUMPADSUB}")
      

      AutoIt also provides a ControlCommand() function such as:

      ; to check   (ADD)
      ControlCommand("Open a New Graph", "", "TCheckBox1","Check")
      ; to UnCheck (SUBtract)
      ControlCommand("Open a New Graph", "", "TCheckBox1","UnCheck")
      

      Issuing commands to window object names means that you do not need to keep track of the positions of controls.

      To obtain the name of the control (value "TCheckBox1" to object ClassnameNN), Au3Info.exe (AutoIt v3 Window Info program) is similar to QTP and Winrunner's Object Spy program, which captures information about controls needed in script code to differentiate and manipulate specific controls.




    Go to Top of this page.
    Next topic this page

    Set screen Next

     

    Bookmark this page:

    Go to Top of this page.
    Previous topic this page
    Next topic this page
    Performance Engineer Life Role Site Map Performance and Capacity Management... Syndicate this list of links:

    Feed Validity Checked RSS 2.0 XML feed
    Feed Validity Checked Atom 1.0 XML feed

     

    How I may help

    Send a message with your email client program


    Your rating of this page:
    Low High




    Your first name:

    Your family name:

    Your location (city, country):

    Your Email address: 

      Top of Page Go to top of page
    Previous topic this page

    Human verify:
     
    Please retype: