Forum Discussion

lleppert's avatar
lleppert
Contributor
11 years ago

Can't click item in infragistics dropdown

Hello,



I am trying to write a keyword test that can select an item out of a dropdown list from an infragistics ribbon. 



The full class name for the ribbon is:

Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea



On my ribbon, I have several items that I have no trouble clicking running the following code snippet:

Aliases.frmMain.zfrmMain_Toolbars_Dock_Area_Top.ToolbarsManager.Ribbon.Tabs.Item(TAB_INDEX).Groups.Item(GROUP_INDEX).Tools.Item(ITEM_INDEX).ClickItem



However, once this item is clicked it produces a dropdown form with the full class name of Infragistics.Win.UltraWinToolbars.PopupGalleryControlTrusted



Though I can navigate to the item in object spy, digging deeper into the above path:

Aliases.frmMain.zfrmMain_Toolbars_Dock_Area_Top.ToolbarsManager.Ribbon.Tabs.Item(TAB_INDEX).Groups.Item(GROUP_INDEX).Tools.Item(ITEM_INDEX).Items.Item(DROPDOWNITEM_INDEX)



I cannot click on the object and there are also not any bounds,coordinates, etc that I can use to click the object.



Is this a supported control? If so, if anyone has any advice on how I can click on these dropdown items it would be greatly appreciated.



Thanks!
  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion Level 3
    Try substituting an integer for DROPDOWNITEM_INDEX at the very end and see if that gives you one of the dropdown values.
  • Thanks for the reply!



    Sorry, I should have been more clear. I am inputting the correct integer for TAB_INDEX, GROUP_INDEX, ITEM_INDEX, and DROPDOWNITEM_INDEX so the expression would look like this for example:

    Aliases.frmMain.zfrmMain_Toolbars_Dock_Area_Top.ToolbarsManager.Ribbon.Tabs.Item(24).Groups.Item(3).Tools.Item(0).Items.Item(2)
  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion Level 3
    Hm.  Did you try a Focus first and then the ClickItem?
  • Hi Lauren,

     


    TestComplete supports this control. Refer to the "Infragistics UltraToolbarsDockArea" article to learn more info. Have you tried just recording the actions over the control? You could check the operations what TestComplete recorded and compare them with yours.


     


    BTW, in your algorithm, it makes sense to add a short delay or the Refresh method before accessing the dropdown menu you open.


     

    • jmassey's avatar
      jmassey
      Contributor

      (Actually, I'll make a new thread, my mistake; just noticed this is in web testing. I'll just refer back. Sorry!)

       

  • Here's an alternative.

    Given a combobox and an itemName to be selected in it;




    For i = 0 To comboObj.Items.Count - 1


      If comboObj.Items.Item(I).DisplayText = itemName Then  


        comboObj.Click


        comboObj.SelectedIndex = i  


        comboObj.Click 


      End If    


    Next