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).
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:
-
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).
-
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.
AutoIt Keystroke Automation Scripts
AutoIt works by compiling each script into an executable stand-alone .exe file that can be run
on target machines.
The AutoIt website offers a free IDE (SciTE.exe) to edit scripts, then compile in one Go step.
(Scintilla-based)
There are different executables for 32-bit (x86) and 64-bit machines.
Begin with the Examples folder containing sample apps and scripts,
such as the SampleControls.au3 in the GUI folder.
AutoIt scripts have a file extension of .au3.
They are written in VBScript format (with no semi-colons).
Because the actions are scripted, I can do extra things (like changing the name of each metric graph)
which is too time-consuming to do manually.
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.
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
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).
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.
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.
|
|
|
|