Forum Discussion

googleid_105206's avatar
googleid_105206
Contributor
12 years ago

how to handle invisible Child Tree items?





Hi

I am Working on Flex4.5 based application using TestComplete 8.6.Iam trying click  child Tree Item.Parent Tree item having more than 30 childItems.

i have to click 30 th Item.But 30 th item not visible.How to handle this type objects.how handle invisible Child Tree items.i followed below code to handle invisible childItem.But giving Error at (objSelectFolder.FlexObject.ensureIndexIsVisible(ItemIndexByText))line.If any method to handle this type of object.



  PropNames= Array("FlexObject.data.name")        

   PropValues= Array("Smart Searches")                    

    set objparentFolder =Context.FindChild(PropNames,PropValues, 11)

         if  objparentFolder.Exists then

        objparentFolder.Click

         else

         log.Message "NotFound"

         End if

       ItemText="AdSearch"

  Set data=objparentFolder.FlexObject.data

 

    log.Message data

     log.Message data.childItems.length

  found = False

  For i = 0 To data.childItems.length

      

  If data.childItems.source.item(i).name=ItemText Then    

     ItemIndexByText = i

     log.Message ItemIndexByText

     objparentFolder.FlexObject.ensureIndexIsVisible(ItemIndexByText)

  

      delay 2000

       found = True

      Exit For

    End If

  Next



 propNames = Array("FlexObject.data.name")

  propValues = Array("AdSearch")

  Set item =page.FindChild(propNames, propValues, 11)

  If item.Exists Then

    item.Click

     delay 5000

   Else

    End If



 

Please Suggest me. how to handle invisible Child Tree items.



Thanks,

Vijay

 

3 Replies

  • Hi,



    I have  Scroll to Specific  child Tree item. Parent Tree item having more than 30 childItems.i have to click 30 th Item.How to scroll to Specific Child Tree item.Please Suggest me.it's urgent requirement.





    Thanks,

    vijay

  • Hello Vijay,





    You should be able to scroll the tree using the "FlexObject.scrollToIndex" method. Does this approach work for you?

    Or do you need assistance implementing it?
  • Hi Alex,



    Thanks for the reply. "FlexObject.scrollToIndex"  Method approach worked for me.My problem was resolved. I can able to handle /click invisible child tree item.












    Thanks,

    Vijay