I am trying to improve a script that contains a third-party Delphi tree of class TElTreeView. I can locate the specified item I want to click and expand in the ElTree1 object but I cannot seem to access it by its index value via TC scripting. I need for the item to be checked, expanded and a couple of the child items underneath it set accordingly.
If I just do the following…
w := p.frmOpts;
tvw := w.VCLObject('ElTree1');
tvw.Selected.Checked := true;
… then the line item that is highlighted by default when the window is opened will be checked. I’ve tried a number of other things but am not so far having any luck. I’m trying to avoid using Sys.Keys.
Any ideas?
Thanks!
You need to compile your application with debug information so TestComplete‘s Debug Info Agent can provide the tool with access to all native methods and properties of the control. Once TestComplete can find debug information, you can access tree items in this way:
Find details on how to correctly compile a Delphi application with debug information for TestComplete in the Debug Info Agent help topic. Click the link corresponding to your version of Delphi to get the steps.
Also, you can vote for advanced support of your control in future versions of TestComplete in this survey.
Update:
Although TestComplete does not have an extended support for the TElTreeView control like for some other wide-spread tree view controls, it is posible to create script routines for working with the control at a high-level. These routines will use TestComplete’s Open Application feature to work with the tree control via its native methods and properties. The below sample script demonstrates how this can be done.