Forum Discussion

NisHera's avatar
NisHera
Valued Contributor
8 years ago

Custom object method not recognized...

In our Delphi application there are custom control bars.. such as   .......Employee_details.VCLObject("dxBarDockControl1").Window("TdxBarControl", "Custom 1", 1) I can click objects in the bar co...
  • tristaanogre's avatar
    tristaanogre
    8 years ago

    From the article concerning testing modal windows (https://support.smartbear.com/testcomplete/docs/app-objects/specific-tasks/modal-windows.html):

    Note, however, that the way you call a modal window may affect the way you work with it. A window may be called by TestComplete methods and actions or by functions located in the tested Open Application. TestComplete methods and actions return immediately after they send the appropriate simulation command to the application under test. Application functions do not typically return values until the modal window they call is hidden. So, if you call an application’s function that displays a modal window, the script execution is paused until this method returns.

    To avoid this problem, use the Runner.CallObjectMethodAsync method to call application functions that display modal windows. This method calls an application function, but does not wait until the function returns (that is, the method does not pause the script execution in TestComplete), so the next code statement can simulate user actions over the displayed modal window.

     

    So, you're line of code would look something like

     

    Runner.CallObjectMethodAsync(Employee_details.VCLObject("dxBarDockControl1").Window("TdxBarControl", "Custom 1", 1).ItemLinks.Items(0).Item, 'Click');