Forum Discussion

LAB's avatar
LAB
Contributor
8 years ago

Dropdown clickitem

I'm trying to selectitem in a drop down using record/playback. The issue is the dropdown is constantly getting updated, and if the record is not visible in the first 10 records then I'm unable to select it.

 

i.e.

 

Dropdown

A

B

C
D
E
F

I am able to select A through F, but if I try to select Z, it cannot find it even though testcomplete recognizes that there are 50+ records in the dropdown. Any way aside from trying to get testcomplete to scroll the bar down that I can consistently select any record from the dropdown?

 

Thanks

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    What code are you using to do the selection?  Technically speaking object.ClickItem('itemtext') should select the item, regardless of how many items in the drop down.  Are you using that method or something else?

    • LAB's avatar
      LAB
      Contributor

      thanks for the response

       

      Aliases.browser.mywebsite.selectCustomer.ClickItem(customername);

       

      I've tested this multiple times, every time the record falls within the visible records when first opening the dropdown, it works, if not, it fails, not sure if it's a timing issue or something else.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        It probably is a timing issue... the contents of the drop down are probably not fully populated yet.

        Something you can try... I BELIEVE, for most such components, there is a "DropDown" method.  Call that first, followed by a SelectItem method and see if that does what you need it to do.