UFT issues using getitemproperty for a node in an WpfTreeView object (using HP-UFT 12.01)

24 views Asked by At

For a script to test an WpfTreeView object, using the getitemproperty statement returns no value. In the code below, the expand, collapse, exists work fine. But the getitemproperty statement does not return any value. Any help would be much appreciated as I'm relatively new to this.

    If Not Obj.Exist(30) Then
        <error processing>
    End If
    test1 = Obj.GetItemProperty(0, "expanded")             ' Does not return anything. Neither True or False
    test2 = Obj.GetItemProperty(0, "firstchild")           ' Does not return anything
    Obj.Expand(0)                                          ' Works fine and node 0 is expanded
    If Not Obj.GetItemProperty(0, "expanded") Then     ' fails but should not
        <error processing>
    End If
    Wait(2)
    Obj.Collapse(0)                                        ' Works fine and node 0 is collapsed
    Wait(1)
    If Obj.GetItemProperty(0, "expanded") Then              ' fails but should not
        <error processing>
    End If
  1. I have tried with restarting UFT and the App being tested.
  2. I can see the tree being expanded and collapsed successfully. So Obj for the tree view is correctly defined. Have tried to see what getROproperty and GetAllROproperties return for the obj. Neither of these return any values
0

There are 0 answers