Forum Discussion

CBleunven's avatar
CBleunven
Contributor
12 years ago

VCLObject method blocks with an unexpected windows

Hi to all,

After a click in a window of my application, a rectangle is added to the draw surface and this rectangle is accessible using the VCLObject  method inTestComplete. I normally get its reference from the parent object, that is successfull when there is no problem.

Addition of an element launches behind the scene a lot of initialisations before the rectangle is draw.



In a problematic build, when adding one of this element, some processus  launched behind fail and I get an unexpected modal window with an error message so this blocks the creation of the VCLObject expected.



I know that the unexpected window handling mechanism occurs only when there are some click or other interaction with the GUI, and so it is normal that it is not activated.



But the problem is that the VCLObject method waits indefinitely and never fails. The progress bar in the TestComplete indicator never start to fill. The Auto-wait timeout is on 10 000 ms in the Project properties.

During this time, I can't stop or pause the test, all requirements are effective only after I close manually the unexpected windows.

The WaitVCLObject method has a similar problem, as there is no object returned until

I manually close the unexpected windows.



Is there a way to handle such a situation in an automatic manner ?



Thanks for your help,

Christophe
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Christophe,



    You need to use the Runner.CallObjectMethodAsync() (see help for more details and code samples) to perform a click.

    The click will be performed asynchronously and your code will be able to proceed further and either check for the window or to rely on the UnexpectedWindow handler.
  • Hi to all,

    does nobody already encountered this problem ?

    This is a strong issue if the test can't fail when such problem occurs.



    Thanks for help,

    Christophe
  • rgratis's avatar
    rgratis
    Frequent Contributor
    As a workaround, you could try doing a Wait...Object type check for the error window itself and using that to fail the test.



    I'm not certain why a Wait...Object method would not time out.  Are there any other errors or exceptions logged by TestComplete during that time?  Other than that, perhaps the application becomes unresponsive on this error.
  • Hi R. Gratis,

    thanks for help. The problem is that I don't expect error window :-) so  I can't predict what will be the error window I can wait for. As we have more than 100 different modules to test, I have a "generic solution" but behind, the possible causes of error are multiple.

    What is surprising is that TC is completely blocked by this error window.

    I will try to design the workaroundfor this window in particular to see if TC may bypass it, but I'm not sure it's a reliable solution.



    Thanks for help.

    Christophe
  • Hi Alexei,

    thank you for help.

    I tried to use the Runner.CallObjectMethodAsync().

    On the click method it doesn't help because the method ends correctly, in all cases.

    I tried to use it on the VCLObject method and here I have some progress as the test continues until the OnLogError method, and from here to the OnStopTest method ( as I call Runner.Stop() ).

    But athe OnStopTest does a call to Sys["WaitBrowser"]() ( this occurs whan I come from an error, in order to ensure I clean everything), and at this step, the test is still blocked, waiting for the rectangle, so on the method I called Asynchronously...



    I'm afraid that this particular case will be more difficult than expected to solve because, when I've tried to get the characteristic of the error window, the Object Spy was blocked until I close the error window.

    The Object Browser remains blank until I close the window.

    And I get a big miss when I tried to reccord the failure...



    The error in this situation is from the Visual C++ Runtime Library, with an incorrect load of the C runtime library. May this interfers with the correct behavior of TC ?



    Thanks for help,

    Christophe
  • Hi All,



    I am also facing problem with unexpected window <Visual C++ Runtime Library> error. It will close Testcomplete.



    It comes while we are selecting any value from Combo box. 



    Also it comes seldomly not alway.



    Can anyone provide me solution for the same?



    Thanks,

    Arun