Forum Discussion

shigeru_nakagak's avatar
shigeru_nakagak
Occasional Contributor
13 years ago

ClickItem for Spark DropDownList (Flex 4.6) does not work at all !!

It should be ClickItem -> Wait for Child (until actual drop-down list is displayed) -> ClickItem for a list Item finally.



With this critical issue, TestComplete is not able to support Flex / AIR, is it??



We do NOT edit every test code.





thanks



Shigeru Nakagaki





  • shigeru_nakagak's avatar
    shigeru_nakagak
    Occasional Contributor
    Is this know issue??



    Are you not going to fix this problem??



    Are you going to drop Flex support??





    thanks



    Shigeru Nakagaki



  • Handling DropDownsList :

    Please Follow Below Ways:

    Method1:

    Sub dropdownList1()

        Set dropdown=Sys.Browser("firefox").Page("pageName").Panel("bodyContent").Panel("flashContainer").Object("MLogin").MLogin("MLogin").NavigatorContent("startNavigatorContent").MModule(0).NavigatorContent("assets").HDividedBox("hdivbox").VDividedBox("leftVDivBox").NavigatorContent("searchQueryNC").DropDownList("searchNames")

        

         dropdown.ClickItem("List Search")

      ''''(or)

         'dropdown.ClickItem(1)

     

        End Sub



    ---------Method2

    Sub dropdownList2()

     propNames = Array("ObjectType", "ObjectLabel")   

     propValues = Array("DropDownList","mainmodule")  



     set ListObject=ObjName.FindChild(PropNames,PropValues, 9)



     ListObject.HoverMouse

       Delay 1000

      ListObject.Keys "[Del]"

      ListObject.keys "USA" 

     End Sub

    --------Method3



    Sub dropdownSelection()



    Dim ListObject, propNames, propValues





    propNames = Array("ObjectType", "ObjectLabel")   * Take Object label Property



    propValues = Array("DropDownList","mainmodule")   * Take Object label Value



    set ListObject=ObjName.FindChild(PropNames,PropValues, 9)  * list object not Found  Increase Depth



    ItemText="USA"



    Set dataProvider=ListObject.FlexObject.dataProvider



    log.Message dataProvider



    log.Message dataProvider.length



    found = False



    For i = 0 To dataProvider.length -1



    If dataProvider.source.item(i).name=ItemText Then   * Check the 'USA ' in Data Provider (name/label) path hierarchy of USA



    ItemIndexByText = i



    log.Message ItemIndexByText



      propNames = Array("ObjectLabel", "ObjectType","ObjectGroupIndex")



       propValues = Array("openButton","Button",0)



       set objDropdownOpenBtn=ListObject.FindChild(PropNames,PropValues, 1)



       objDropdownOpenBtn.Click



       delay 1000



    ListObject.FlexObject.ensureIndexIsVisible(ItemIndexByText)



    delay 2000



    found = True



    Exit For



    End If



    Next



    If  found =True then



    Set app =ListObject.Parent

      Do Until app.ObjectType ="Object"

        Set app = app.Parent

      Loop



    ' Find the list item object by text



    propNames = Array("ObjectType", "Caption")  * Take ObjectLabel/Caption/ObjectIdentifier



    propValues = Array("DropDownList",ItemText)



    Set item =app.FindChild(propNames, propValues, 2)



    If item.Exists Then



    item.Click



    Log.message ItemText& "Select form Drop down list"



    Else



    Log.message ItemText& "Was not Select form Drop down list"



    End If



    Else



    Log.Error "DropDownList item """ & ItemText & """ was not found."



    End If

    End Sub





    Let me know how this works for you.



    Thanks,

    Vijay

    d.kavijay@gmail.com








  • Vijay, thanks for your examples!


     


    Shigeru, could you please reply whether Vijay's methods help you?