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 control using it's internal method ...for eg "Apply" button could be done like...
Employee_details.VCLObject("dxBarDockControl1").Window("TdxBarControl", "Custom 1", 1).ItemLinks.Items(0).Item.Click();
But TC would not recognize it as an click event. So there is not feed back.
(Eg "......... was clicked with the left mouse button." )
Further to that if there is a error or message poped-up, test stuck forever without going to next step. (though I have written scripts to handle that error/message)
There is a dirty way of doing same thing.. (Got that when recording..) as below
Employee_details.VCLObject("dxBarDockControl1").Window("TdxBarControl", "Custom 1", 1).Click(198, 14).
Which will generate event "The window was clicked with the left mouse button ". But I'm reluctant to use that since the coordination are subject to change.
Any help?
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');