Forum Discussion

amithsid's avatar
amithsid
Contributor
10 years ago
Solved

False Error by TestComplete when working on TreeView20WndClass List Object

Hello,



I am using JS Scripting and want to perform a check action on an Item in a Listview.

The wndclass is TreeView20WndClass.

The code used to do so-

                                      testObject.CheckItem("|Item1", false);   

On execution, TC returns an error after checking the item as "The tree node's '<No Admission Type Selected>' state image was clicked, but the node stayed in the checked state.".

But the item was checked and a change in state happened.



How to stop this error?

I have also attached screen shots for reference.



Or tell me how to perform a check action on it?

  • Hi Amith,


     


    Can you create a sample app containing this control and post it here so that we could play with it?


     

5 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Amith,


     


    Without testing a control, it's difficult to say what approach you can use. Try the following:


    1. Check whether the TreeView20WndClass control is inherited from a control that is specially supported by TestComplete. If it is, use the Object Mapping feature to make TestComplete treat the control as a supported control.


     


    2. If the control isn't inherited, you will need to create your own CheckItem function by using native properties and methods of the control. Analyze the control's properties in TestComplete's Object Browsers.

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Amith,


     


    Can you create a sample app containing this control and post it here so that we could play with it?


     

  • Hello Tanya,



    Thanks for your reply, Sorry I cannot post the application here due to secuity reasons, instead I have attached the screenshots of the app and the error report.

    I wil try to provide you the handson on it.



    oresle, can you tell me how to perform a check on an item in the TreeView20WndClass Listbox?

    Refer to attached fies.



  • Hi Tanya,

     

    I have already added that listbox to TestComplete by using the Object mapping, and the control as shown by Object mapping window is TreeView20WndClass and it has successfully mapped. The problem is, if I use CheckItem("item", false) on it, it checks the item and then it cannot detect the change.

    What is the solution?

     

    Thank you,

    Amith

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Amith,


     


    The value of the Checked property should identify the control's state. Has its value changed after performing the CheckItem property?


    One of the reasons why the state hasn't changed may be related to the fact that your control is not fully inherited from the control you used for mapping.