The main purpose of this utility is the close work with TestComplete3.xxfrom AutomatedQACorp.. Using My@LocVarPanelallows you to achieve incredible control over the execution of your automated test scripts.This tool has two main parts:
This part of the My@LocVarPanellists all localvariablesused in the specified TestComplete project.

The unique specifics of My@locVarPanelis that you can change values of TestComplete local variables at any time regardless of whether your script is being edited or being executed. This feature gives you the enormous freedom to change the way of how your scripts are run, since changing a value of a local variable via My@LocVarPanel, you immediately change it in TestComplete.
Note, you need to reopen the TestComplete project in My@LocVarPanelif you modify the list of local variables via TestComplete to make sure that the panel shows the up-to-date variables list. You need to save the project in TestComplete before reopening it My@LocVarPanel.
What is more, if you if you have one project opened in My@LocVarPaneland another in TestComplete, it may see the following error when editing local variables via My@LocVarPanel:
To avoid this problem, please keep the same project opened in both systems.
This My@LocVarPanelpart includes script management controls.

The way how this panel looks is your own duty :-). There are no limitations for the number and layout of controls placed on it. The only limit is your own fantasy.
The Options panel is used to control your My@LocVarPanel parameters.

The “Usethisshortcuttoquickrestore” checkbox – when it is set, you can quickly activate My@LocVarPanelusing the specified shortcut when needed.
The “ControlDesigner” button – pressing this button invokes the Controldesignerof the panel. You can use the designer to create and design script managements controls. Please see the Controldesignersection for more details..
The“SaveControlslayout” and“LoadControllayout” buttons – using this buttons you can save / restore the designed controls layout. During your work you can create a wide set of different panels and use them when needed.
“Registry Key path “ and“Registry key’s value name” – these options are needed to use the Timer component. Since the possibility of creating times that fires events was added only to TestComplete 4, we implemented this feature in My@LocVarPanel so that you can use it with TestComplete 3. Using timers has a lot of advantages. For example, you can use them in load test scripts when from time to time you need to perform some specific actions.
Checkbox“EnableTimerpoll?”– this is the debug option allowing you to see how your timers will work during your panel design.
Controldesigneris the main tool to create new and edit existing control panels.

At the top of the Controldesigneryou see the palette of available script management controls. This palette includes the most important and frequently used controls. To place a control onto your panel, just click the needed element on the palette and then click the panel.
The “Adjustablecontrols” checkbox – if this checkbox is active, all the controls placed on the panel become moveable and realizable.
The “Name”, “Hint”, “Caption/Text” text fields – are used to edit the corresponding properties of the selected control.
The“Value” spin edit – sets the value of the selected control if it is “Gauge”, “ProgressBar” or“TrackBar”
The “Min”, “Max” spin edits – set the max and min values for the controls of the following types: “Gauge”, “ProgressBar”, “TrackBar”.
The “isVertical/isHalfCircle/isChecked/Enable” radio group – are used to to set special boolean property values: “TrackBar.isVertical“, “ProgressBar.isVertival”, “Gauge.isHalfCircle”, “CheckBox.Checked”, and “Timer.Enable”.
The “Codeassist” memo- it shows the script code that you can use in TestComplete to create controls programmatically.
The “RenewCodeAssist” checkbox – if it is active, “Codeassist” memo will include code to create all controls that you select on the panel. This is useful if you want to gather the code for complete panel creation.
The “CopytoClipboard” & “Clearcontrols” buttons – use them to copy the content of the “Codeassist” memo or clear it.
The My@LocVarPanel provides a set of built-in functions that you can call from TestComplete. You can see their list via TestComplete's Object Browser:
:
These function allows you to create controls, save or load a layout to / from a file or clear the panel. All of them are prefixed with “_FromTC_”. Every function has its own specific syntax and parameters. It may be difficult for you to start using them, but "Code assist" from the "Control designer" should help you.
Here is some sample code that illustrates how to create a control button:
Procedure CreateButton;
var p, wPanel, wButton;
begin p := Sys.Process('LocVarPanel'); wPanel := p.MainFrm; wButton := wPanel._FromTC_CreateButton('MyPanelBtn', 'This is my first button', 'Press me', 34, 60, 32, 76); end;
Lets see how it works:
p := Sys.Process('LocVarPanel');
wPanel := p.MainFrm;
The line above shows to to access the panel. Here is the code that actually creates a control button:
wButton := wPanel._FromTC_CreateButton('MyPanelBtn',
'This is my first button', 'Press me', 34, 60, 32, 76);
The function for creating the button is called with the following parameters: Name,Hint,Caption,Top,Left,Height,Width.
Function name |
Parameters |
Comments |
_FromTC_CreateCheckBox |
RName, RCaption, RHint : String; RTop, RLeft: integer; RState: Boolean |
Creates a CheckBox. Used for editing boolean parameters. Its main property is Checked and when it is True, checkbox is checked False otherwise. |
_FromTC_CreateEdit |
RName, RHint, RText : String; RTop, RLeft: integer |
Create an Edit. Used to edit alfa-numeric data. Its binding to a parameter is done via the Text property. |
_FromTC_CreateGauge |
RName, RHint : String; RTop, RLeft, RWidth, RHeight, RMin, RMax, RValue: integer; isHalfCircle: Boolean; Note: if isHalfCircle equals to True, the control is created as a semicircle where 100% = 1800, otherwise, 100% = 3600. |
Creates a Gauge. Used to show percent values bound to the Progress property. The range of possible values is from 0 to 100. You can control it via the Min & Max properties. It also has the Value property that is alternative to the Progress property. |
_FromTC_CreateLabel |
RName, RCaption : String; RTop, RLeft: integer |
Creates a Label. Used to simply display a parameter value. Its main property is Caption. In addition, you can use its Color property. |
_FromTC_CreateMemo |
RName, RHint, RText: String; RTop, RLeft, RHeight, RWidth: integer |
Creates a Memo. Used to show multiline text, for example logs. Memo.Lines.Add(S : string) – is the command that adds a string to the memo control. |
_FromTC_CreateProgressBar |
RName, RHint : String; RTop, RLeft, RSize, RMin, RMax, RValue: integer; isVertical: Boolean |
Creates a ProgressBar. Used to show a progress of a process. Its Position properly must be in the range specified by the Min & Max properties. You can change Position in a loop to control its state. |
_FromTC_CreateSpinEdit |
RName, RHint : String; RTop, RLeft, RMin, RMax, RValue: integer |
Creates a SpinEdit. Used to enter/modify decimal parameters. Its Value property cannot exceed the range specified by its Min & Max property values. |
_FromTC_CreateTrackBar |
(RName, RHint: String; RTop, RLeft, RSize, RMin, RMax, RValue: integer; isVertical: Boolean |
Creates a TrackBar. Used to display or set parameter values. The value is stored in the Position property which is limited by the range specified via the Min & Max property values. |
_FromTC_CreateButton |
RName, RHint, RCaption : String; RTop, RLeft, RHeight, RWidth: integer |
Creates a Button. Using buttons gives you unlimited control on your script execution. Using the event-based system of TestComplete, you can create scripts that reacts on your buttons pressing and calls corresponding procedures. The sample shipped with the installation shows how to do this. |
_FromTC_CreateTimer |
Ident, Interval : word; RTop, RLeft: integer Note: Ident– is an identification of a timer in the timers pool. RTop, RLeft– coordinates of the timer placeholder visible at design-time. The function returns the number of the newly created timer in the timers pool. If it returns -1, it indicates that an error has occurred and the timer was not created. Even if you can created an unlimited number of timers, you should remember that TestComplete may not react on timers with very small interval values. What is more, you may have situations when more than one timers are triggered at the same time. |
Creates a Timer. Timers is the feature that was missed in TestComplete until v4. You can create a lot of timers on the panel that will force execution of different service functions. Our demo shows how to use them in action. |
When using functions that creates controls, only the key property values are passed via parameters. However, once a control is created, you can access and modify all its properties. You can see all of them via the Object browser.

This figure shows a Label control called Lbl1. Its Font.Color = ClBtnFace and Font.Size= 8 |
You should be carefully when editing additional properties, since not all of them have simple numeric values. Based on the fact that My@LocVarPanelwas created using Delphi and was compiled as an OpenApplication (see the TestCompletedocumentation), we "see" all functions and properties of the controls created on the panel. This allows us to access their properties in the very same way as if we access them in the Delphi IDE. For those who are not familiar with, here is the list of most commonly used control properties.
Property |
Comments |
Enabled: Boolean |
Specifies whether the control is editable |
Height: integer |
|
Width: integer |
|
Hint: string |
|
Visible: Boolean |
Specifies whether the control is visible |
Tag: integer |
An integer value associated with the control. For example, you can use it to numerate controls |
Color: integer |
Available for Memo, Label, SpinEdit, Gauge. Here is the list of built-in values: clBtnFace, clBtnHighlight, clBtnHighlight, clBtnHighlight, clCaptionText, clCaptionText, clGradientInactiveCaption, clInactiveBorder, clInactiveCaptionText, clMenuHighlight, clScrollBar- these colors depends on the current Windowscolor schema; clBlack, clRed, clYellow, clMaroon, clMaroon, clMaroon, clMaroon, clPurple, clTeal, clGray, clSilver, clLime, clBlue, clFuchsia, clAqua, clWhite, clMoneyGreen, clSkyBlue, clCream, clMedGray– constants for absolute colors. |
WordWrap: Boolean |
Available for Label, Memo, Button. If True, the text will be wrapped if it does not fit by the length of the control. |
Font.Color: integerFont.Name: stringFont.Size: integer |
Available for MyGauge, CheckBox, Button, Label, Memo, SpinEdit. Specifies the control's font properties. |
Create a new TestComplete 3 project, select Delphiscriptas the programming language and paste the following code in the editor:
var
ValueArray; Procedure MoveHistoryBars;
var i;
begin
for i := 1 to 29 do
begin
ValueArray[i].Position := ValueArray[i+1].Position;
end;
end; Procedure HistoryBars;
var
w, p, wPanel, wButton, Alb, Blb, RandomCB;
A, B, CurrentValue, i :integer;
y, temp :real;
begin
p := Sys.Process('LocVarPanel'); wPanel := p.MainFrm;
wPanel.Activate; ValueArray := CreateVariantArray(1,30); wPanel._FromTC_ClearControlForm; wPanel._FromTC_CreateLabel('Label1', 'f(x) = cos(y)*A+B', 9, 52);
wPanel._FromTC_CreateLabel('ALb', 'A:', 34, 36);
wPanel._FromTC_CreateLabel('BLb', 'B:', 32, 366); ALb := wPanel._FromTC_CreateTrackBar('ATrB', 'Value "A"', 48, 30, 280, 0, 100, 50, True);
ALb.width := 20; BLb := wPanel._FromTC_CreateTrackBar('BTrB', 'Value "B"', 47, 360, 284, 0, 100, 50, True);
BLb.width := 20; RandomCB := wPanel._FromTC_CreateCheckBox('RandomValueCB', 'Random value: f(x) = Random(A)', '', 340, 144, False);
RandomCB.width := 200; for i := 1 to 30 do
begin
ValueArray[i] := wPanel._FromTC_CreateProgressBar('PB' + IntToStr(i), IntToStr(30-i) + '-Sec', 32, 50 + (i*10), 300, 0, 100, 0, True); ValueArray[i].Width := 10;
end;
y := 0;
repeat
A := ALb.Position;
ALb.Hint := ALb.Position;
B := Blb.Position;
Blb.Hint := Blb.Position;
temp := Cos(y);
CurrentValue := temp * A + B; if RandomCB.checked then
CurrentValue := Random(A); MoveHistoryBars; ValueArray[30].Position := CurrentValue; y := y + 0.1;
if y > 270 then y:= 0;
until false;
end;
Run My@locVarPanel and then run the HistoryBars procedure. Once you do this, the panel will show the created controls and you will be able to start using it
When you use the My@Suite Enterprise setup, it will install and register a special ActiveX component designed to provide Timers. To use its events in TestComplete, you need to invoke the "Configure Components" dialog availed via the "Configure Components"context menu item of the Component Palette. Just select myPanelEventCaller in the list of available ActiveX components and press OK

Once you do this, you can start using it. Please review the demo included in the installation for details.
See also: