cancel
Showing results for 
Search instead for 
Did you mean: 

How to not drop-down combobox every time data is read from it?

Highlighted
Contributor

How to not drop-down combobox every time data is read from it?

Every time I try to obtain wItemCount or wItem the combobox drops down, I don't see why it needs to do this every single time. I can use the object browser to get all of this data without seeing the drop down come down once.





Is there something I need to do to stop it from dropping down the list every time?  Dropping down the list every time significantly slows down the time it takes my script to complete.





Thanks
3 REPLIES 3
Highlighted

RE: How to not drop-down combobox every time data is read from it?


Hi Ted,





This behavior is normal. There are combo boxes that build the entire list of items only when expanding, so to be sure that the items of your combo box are recognized, we expand a combo box (when using wItemCount and wItem from script).





If this is annoying for you, you can use native properties to get access to items of your combo box. For example, you can use the ItemCount and Items native properties:





// Our sample application - Orders (Delphi):

// "C:\Users\Public\Documents\TestComplete 7 Samples\Open Apps\OrdersDemo\Delphi"

// Run exe, select "Orders | New order..." and run the following script





var combo = Sys.Process("Orders").VCLObject("OrderFrm").VCLObject("Product_ComboBox");

for (var i = 0; i < combo.ItemCount; i++) {

  Log.Message(combo.Items.Strings(i));

}

--
Dmitry Nikolaev

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Contributor

RE: How to not drop-down combobox every time data is read from it?

There has got to be a way to not do drop down these boxes every time.  It takes up valuable time and is very annoying.  I want the static data.  I don't believe our application supports the methods you suggested, because I can't figure out a way to get them to work.  Like I said previously, I can pull up the object browser get all of the necessary information and the drop down never every comes down, so why is it necessary during my script to do so.  Has a workaround I tried the example given in the Help to get the Combobox items using wItemList thinking I could use the item list data to do the checks I need to do before selecting an item, but even that resulted in the drop down coming down 3 times.












Highlighted

RE: How to not drop-down combobox every time data is read from it?

Hi Ted,




I don't believe our application supports the methods you suggested



Did you compile your application with debug info? If you didn't, please do this by using instructions from the "Open Applications in Delphi" help topic.


If your application is compiled with debug info, please use the Object Browser to check whether your check box controls have necessary properties (see the "Object Browser Overview" help topic).



Best regards,
Alexey

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!

Retrieve Data from a Web Page

Participate!
Top Kudoed Authors