Forum Discussion

kaiiii's avatar
kaiiii
Regular Contributor
7 years ago

Select an item from a list box

I am working on Android Device. In a Scenario where i have to choose one item from a list.
I created an object for that drop box using object spy, but in ControlText only one item is shown. How can i make an object hat have all the list item in it and easily accept Keys function.

3 Replies

  • cunderw's avatar
    cunderw
    Community Hero

    Looking at the documentation, I would think you would want to use SelectItem not Keys. Does your list have SelectItem on it?

     

    Can you provide screen shots of the object properties and the available methods? That will help determine a solution. 

    • kaiiii's avatar
      kaiiii
      Regular Contributor

      No.. SelectItem is not a property of that object

      The properties of that object below:

      Keys

      Drag

      Touch

      LongTouch

      Click

       

      Will post screenshot soon..sorry for inconvenience

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Another possible option is that your list control is not a 'classic' one but a combination of two separate controls that interact one with another. And this may be the reason of why the first 'master' control contains only one list item - just because complete list is contained in another complimentary control.

    Three options are usually possible in this case:
    -- Look for and use native control's method that is used by developers to select an item for this control;

    -- Use .Keys() method to emulate as if human user just types the needed value in the control but not selects the value from the list;

    -- Do required actions to open drop-down, identify it (Object Spy in the Point-and-Click mode) and search for the needed item within the found control.

     

    Note, that sometimes, depending on your tested application, you might need to use a combination of the above methods. For example, after the item was selected via the native method call, you might need to emulate pressing Enter key in the control in order to explicitly trigger some event (e.g. OnChange) that other code in the tested application relies on.