Jump to content
Sign in to follow this  

How to Get Count of Items in 3rd Party ComboBox?

Recommended Posts

I have an AutoIt script that takes control of a third party Windows application at a financial firm, automatically imports records from an Excel spreadsheet, and does numerous other things.

There's one particular screen within this third party application that sometimes takes a while to open and become fully "ready" for the AutoIt script to continue controlling items on the form, clicking on buttons on the form, etc.

The main area that hangs when this specific form opens deals with a drop-down / combobox that occasionally takes a bit to populate with a list of SQL Server machines that can be connected to.  So, in one instance of control of opening this form by AutoIt, the form may be successfully opened and the specific drop-down box I'm referring to be populated and accessible in 5 seconds.  Depending on the time of day though, this drop-down box might take 13 seconds (for example) to populate if things are moving slowly.

I'd like to come up with a way to count the # of items populated in the drop-down / combobox and basically hold-off on trying to proceed with AutoIt's control of other command buttons / etc. on the form until it's determined that the combobox is fully populated.

Hope that makes sense.  I haven't found a way yet based on my research to do a count like what I'm describing.  Seems to be a way to do a count on an AutoIt-created drop-down box control, but not on an already-existing control in a third-party Windows application that I'm trying to have AutoIt to access/control.

Any recommendations or helpful hints would be appreciated.  My script is crashing frequently due to this random delay that occurs and I hate to just throw-in an extended "Sleep" statement in the script when, in many cases, I'd be having the script sleep for an unnecessary time if it happens to be one of the times that the form opens quickly and the combo-box in question is populated with all entries quickly.



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...