Forum Discussion

mortenb123's avatar
mortenb123
Contributor
4 years ago
Solved

desktop dropdown example getting number

A simple example on how to get the numbers of items in a dropdown and their name:, the only thin I manage is to click its index:

function cardpocket(var item=0) {
  sp = Aliases.LraClient.CardInfoView.StackPanem.SelectPocket;
  if sp.Exists) {
    sp.ClickItem(item);
  }
}

sp.Items return an object, but its length=0. there is no PropertyItem, I assume I need to do some Child() navigation but haven't found any examples on this.

 

 

 

  • AlexKaras's avatar
    AlexKaras
    4 years ago

    Hi,

     

    I think that you need to talk to developers and ask them about this control.

    It might be that control is composed from two (independent) parts: arrow and the list that is displayed after the arrow is clicked. (You may check this with the help of the Object Spy in the point-and-fix mode: open the drop-down and check if the list is recognized as a separate control. If this is the case than you will have to click on the arrow, wait until the list is displayed and populated with values and then work with the list itself.)

    Control might appear to be composite one. In this case https://support.smartbear.com/testcomplete/docs/app-testing/desktop/wpf/template-support.html might help.

     

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    It would be helpful to know more about the drop down control itself.  Can you post screenshots of the Object Spy indicating properties, etc., of the drop down object?

    • mortenb123's avatar
      mortenb123
      Contributor

      Enclosed pictures, there is no name on the dropdown, just a down arrow, but I'm unable to get the '2' or the '3' or the number of items:

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        I think that you need to talk to developers and ask them about this control.

        It might be that control is composed from two (independent) parts: arrow and the list that is displayed after the arrow is clicked. (You may check this with the help of the Object Spy in the point-and-fix mode: open the drop-down and check if the list is recognized as a separate control. If this is the case than you will have to click on the arrow, wait until the list is displayed and populated with values and then work with the list itself.)

        Control might appear to be composite one. In this case https://support.smartbear.com/testcomplete/docs/app-testing/desktop/wpf/template-support.html might help.