We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More
This site is now read-only. You can still browse and search as usual. Learn More
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!
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.
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.
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?
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.
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!