Forum Discussion

lhuang5's avatar
lhuang5
Occasional Contributor
12 years ago

How to determine whether a tree node is checked or unchecked?

Hi, 



I need to check the state of a tree node in one test. The type of tree is ClrUiTreeCtrl. I have tried a way to check this value: treeNode.CheckedState.OleValue. This value is always "Unchecked" when this node is checked or not. 

Can anyone give me some suggestion? Thanks. 

I am using TestComplete 9.



3 Replies

  • Ravik's avatar
    Ravik
    Super Contributor
    Hi Liping,



    You can try alt property for tree node. it will be give you value like - [Expand]/[Collapse].



    If the value of alt = Expand then you go and click on it for explore tree node.

    or

    If the value of alt = Collapse then go and click to hide details.



    This might help you.
  • lhuang5's avatar
    lhuang5
    Occasional Contributor
    Thanks for your reply.   However it seems not to be able to solve this problem. Here I will describe my problem more clear.



    We have some Data Tree and need to check the state of the node. We had hacked the CheckedState of node object in our software in the beginning. Now this hacking is removed from our software. Is  there any other ways to do such checks. 



    I also attached a pic to show the checked  and unchecked nodes as an exmaple.



    Thanks!

  • Hi Liping,


     


    As a third-party tree control with the ClrUiTreeCtrl class name is used in your app, it's difficult to tell for sure what property or method you need to use. That would be great if you created a sample app containing the control and shared it with us - in this case, we could play with it.


     


    You should be able to test the control via its native properties and methods. Try exploring TestComplete's Object Browser to find the needed one. To make sure that you see all properties/methods of the object, switch to the Advanced View mode and make TestComplete show hidden properties (Tools | Options | Engines | General | Display members | Show hidden members).