cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown clickitem

Highlighted
Contributor

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 3
Highlighted
Community Hero

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?


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
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.

Highlighted
Community Hero

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors