cancel
Showing results for 
Search instead for 
Did you mean: 

ClickItem( ) Very Slow For DropDown/ComboBox

SOLVED
Highlighted
Contributor

ClickItem( ) Very Slow For DropDown/ComboBox

The drop down list appears immediately, but then its consistently 16 seconds for the item to be selected - whether the input is an index, string name or wildcard, there is no difference.  Has anyone re-written this method to be faster?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Contributor

Re: ClickItem( ) Very Slow For DropDown/ComboBox

So the problem seems to be that the items are not children of the dropdown object!  I ended up clicking on the dropdown to display the items, then using FindChild() with a different parent and the JavaFX class of the items.  Now able to select fairly quick.  Thanks!

View solution in original post

5 REPLIES 5
Highlighted
Community Hero

Re: ClickItem( ) Very Slow For DropDown/ComboBox

What specific drop down component is it?  

The ClickItem() method is actually a wrapper that TestComplete puts on ComboBox objects to do the particular action.  Depending upon the specific component type that it is, there may be ways of utilizing the more native methods on the component to do the same action that MAY be faster.  

 

One possibility, though, for the delay might be that the drop down list is dynamically generated.  So, TestComplete, after clicking on the component, needs to wait for the specific item to be populated in the drop down list before it can click.  Immediately AFTER clicking the component, there may be a split second where the item does not exist yet, causing TC to wait a bit.  So, one possible work around is that, if the drop down list is dynamically generated, try calling a Click() followed by a ClickItem call and see if that works.


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

Re: ClickItem( ) Very Slow For DropDown/ComboBox

Thanks for the quick reply.   We're at the end of a Sprint, so took me awhile to reply.  It is a JavaFX ComboBox.   The dropdown appears quickly with all items populated which is why it seems so strange it would take so long to actually click on the specific item.   I've looked into a few native methods such as setValue() and getSelectionModel().select(), but can't seem to find one that works.

Highlighted
Community Hero

Re: ClickItem( ) Very Slow For DropDown/ComboBox

Hrm... that is strange.

Is there some other code that is being executed with the OnClick of the control? It's possible that, when you click on the control with "click item", there's an event that's being fired that, in order for the process to continue, TestComplete needs to wait for it to be done.  It does seem strange but I think, when it comes to interacting with components, there is some level at which TC checks after an action is completed to determine if it was successful.  If there is other code that is being executed before that returns to TC, this could be interfering..

 

Mind you, this is just a guess.  Perhaps check with your developers and see if they can give some insight on that?


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

Re: ClickItem( ) Very Slow For DropDown/ComboBox

I did a quick bit of investigation on that control... there is a method for "DropDown".  What happens if you call

 

control.DropDown();

control.ClickItem(itemName);

 

Like that?  Break up the action into two steps.  Does the same delay happen? If so, does it happen on the drop down or on the ClickItem?

My GUESS... is that it's happening on the drop down... but again, just a guess.


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

Re: ClickItem( ) Very Slow For DropDown/ComboBox

So the problem seems to be that the items are not children of the dropdown object!  I ended up clicking on the dropdown to display the items, then using FindChild() with a different parent and the JavaFX class of the items.  Now able to select fairly quick.  Thanks!

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors