I am on Delphi 5, using TestComplete 7.52 Enterprise .
We have a toolbar (TRzToolbar) which has several buttons to select the appropriate one. Using TC i have seen a peculiar behavior as:
1. Open TC and click on Object Properties window and Spy on toolbar item, here it identifies the each buttons in toolbar as TRzToolButton.
2. Create a project suite-> Project. Click on Object Properties window, Spy on the same toolbar, now it fails to identfies the buttons in toolbar and shows the entire toolbar item as single object as TRzToolbar.
Workaround: DblClick Project, select properties tab, Map objects, AddClassName: TRzToolbar under Toolbar items.
Record the script... still it identifies using coordinates.
Tried Mapping the TRzToolButton as win32 Button and failed.
So any other luck.... [img]/images/graemlins/smile.gif[/img]
We have already replied to you within the M0072398 query. Here is a quotation from the message:
[ QUOTE ]
There is no special support for this control in TestComplete. However, you can compile your application with debug information and work with the TRzToolbar control via its native properties and methods. See the "Debug Info Agent" help topic for the information.
The script below demonstrates how to work with the target toolbar control:
var p = Sys.Process("RCDemo");
var wMain = p.VCLObject("frmMain");
var wToolBar = wMain.VCLObject("tbrMain");
var strItem = "Custom Framing";
if (clickButton(wToolBar, strItem))
Log.Message("The '" + strItem + "' button was successfully clicked.");
function clickButton(wToolBar, strItem)
var controlCount = wToolBar.ControlCount;
for (var controlId = 0; controlId < controlCount; controlId++)
var controlObj = wToolBar.Controls(controlId);
if (SameText(controlObj.Caption, strItem))
Log.Event("The '" + strItem + "' button was clicked.");
Log.Error("The '" + strItem + "' button was not found.");