Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7787539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:42:16+00:00 2026-06-01T20:42:16+00:00

I am trying to improve a script that contains a third-party Delphi tree of

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:42:18+00:00Added an answer on June 1, 2026 at 8:42 pm

    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:

    procedure Test;
      ...
      w := p.frmOpts;
      tvw := w.VCLObject('ElTree1');
      tvw.Items.Item(1).Checked := true;
    end;
    

    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.

    function getTreeNode(tree, nodeName); forward;
    function clickTreeNode(tree, node); forward;
    
    procedure test;
    var
      tree;
      nodeName;
      node;
    begin
      tree := Sys.Process('ElTreeTest').VCLObject('Form1').VCLObject('ElPanel1').VCLObject('ElTree1');
      nodeName := 'Item B|Item BB|Item BBA';
      node := getTreeNode(tree, nodeName);
      if node <> nil then
        Log.Message(node.Caption)
      else
      begin
        Log.Error('Node "' + nodeName + '" not found');
        Runner.Stop;
      end;
    
      node.MakeVisible;
      node.Checked := not node.Checked;
      clickTreeNode(tree, node);
    end;
    
    function clickTreeNode(tree, node);
    var
      x, y;
    begin
      node.MakeVisible;
      x := (node.TextRect.Left + node.TextRect.Right) / 2;
      y := (node.TextRect.Top + node.TextRect.Bottom) / 2;
      tree.Click(x, y);
    end;
    
    function getTreeChildNode(rootNode, nodeName);
    var
      i;
      item;
      nodeCaption;
    begin
      result := nil;
      if rootNode = nil then
        exit;
    
      nodeCaption := aqString.GetListItem(nodeName, 0);
    
      for i := 0 to rootNode.ChildrenCount - 1 do
      begin
        item := rootNode.Children(i);
        if item.Caption = nodeCaption then
        begin
          result := item;
          break;
        end;
      end;
    
      if aqString.GetListLength(nodeName) > 1 then
        result := getTreeChildNode(result, aqString.DeleteListItem(nodeName, 0));
    end;
    
    function getTreeNode(tree, nodeName);
    var
      rootNodeCaption;
      item;
      i;
    begin
      aqString.ListSeparator := '|';
      rootNodeCaption := aqString.GetListItem(nodeName, 0);
      result := nil;
    
      for i := 0 to tree.Items.Count - 1 do
      begin
        item := tree.Items.Item(i);
        if item.Parent = nil then
        begin
          if item.Caption = rootNodeCaption then
          begin
            result := item;
            break;
          end;
        end;
      end;
    
      if aqString.GetListLength(nodeName) > 1 then
        result := getTreeChildNode(result, aqString.DeleteListItem(nodeName, 0));
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to (slightly) improve a script that does a quick-and-hacky parse of some
I am trying improve the fault tolerance in a JSP-page that is updated on
I am trying to improve the following script a little: $(document).click(function(event) { $('.home.active').click(); $('.home').removeClass(active);
I need some help trying to improve the speed of my script. Heres the
I'm trying to improve the performance on a query that is running very slowly.
I'm trying to improve the performance of a javascript snippet evaluator . These script
I'm trying to improve performance of my script. I want to improve this: el.removeClass(
I was trying to write a script that checks the second text field if
I'm new at Greasemonkey. I'm trying to create a user script to improve my
I'm trying to create a simple ajax load test script that dynamically creates divs,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.