Forum Discussion

exdunepilot's avatar
exdunepilot
Contributor
8 years ago

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?

  • exdunepilot's avatar
    exdunepilot
    8 years ago

    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!

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    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.

    • exdunepilot's avatar
      exdunepilot
      Contributor

      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.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        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?