Forum Discussion

jsc's avatar
jsc
Regular Contributor
13 years ago

Unexpected window not handled by test

Hi all,



I got sometimes do have problems with an unexpected windows, that unfortunately are not handled by my test correctly.

The window that currently causes my test to hang can be seen in the attachment. The parent process' name is: "genesis.exe"



I do 3 things to make my test handle such problems:

1) project settings:

on unexpected window: press Esc, press Enter, Send WM_CLOSE, Click on focused control

>> Escape, Enter and focused control should close this window (manually tested), but the test does not!



2) event handler for unexpected windows (see end of text)

>> window.close does not close this window



3) event handler for timeout (see end of text)

>> My event handler for timeout is not called after a few minutes. (timeout time is 6 minutes)

>> itdGenesis.killClient() contains the killing of the parent process "genesis.exe".



So my questions are:

1. why is the window not closed by the settings to close unexpected windos (esc, enter, focused control)?

2. why is my event handler for timeout not called after few minutes? (the test hung for a whole night!)



I hope somebody can help me with this, as I thought my test is able to deal with this.



Thanks a lot in advance,



Joachim



--------------------------------------------------------------------------



function OnTimeout(Sender, Params)

{

  Params.Break = true;

  Log.Message("#itdLogCode#OnTimeout# Testitem '" + Project.TestItems.Current.Name + "' hat die Timeout-Zeit von " + Project.TestItems.Current.Timeout + " Minuten ueberschritten.");



  itdGenesis.killClient();

  return Params;

}



function OnUnexpectedWindow(Sender, Window, LogParams)

{

  Log.Error("#itdLogCode#OnUnexpectedWindow# Unexpected window");

  Log.Picture(Sys.Desktop.Picture(), "Unexpected window", "This image was added to TestLog from the GeneralEvents_OnUnexpectedWindow procedure");

  Window.Close();

}

7 Replies

  • jsc's avatar
    jsc
    Regular Contributor
    Ok, I checked my tests more deeply.

    The window IS HANDLED correctly by the unexpected window error handler in most of the cases. (error message and screenshot posted to the log)



    Just in one case the window is not handled by the test. It is not closed and the test is hanging.

    When I stop the test manually via the stop-button the test does not end, i have to kill the testcomplete process via taskmanager.



    Can anybody help me with this?



    Joachim
  • Hello Joachim,

    Could you please specify what version of TestComplete you are using? Does the issue occur on the latest version of TestComplete - 9.0? If you need a free trial version of TestComplete 9.0, you can request it at the Free TestComplete Trial page of our web site.

    Could you please use the Contact Support web form and send us your problematic application and your test project so that we could reproduce your problem?

    Thanks in advance.
  • jsc's avatar
    jsc
    Regular Contributor
    Hi Julia,



    I am currently working with 8.70.

    I will update Testcomplete within the next days and will then check, if the problem still exists



    Greetings,



    Joachim
  • jsc's avatar
    jsc
    Regular Contributor
    Hi all,



    the attached unexpected window is one that unregularly occurs, that my test cannot handle at all.

    It is (afaik) thrown by Windows (win 7 professional is used), the process is "WerFault.exe" (at least the window is closed if I kill this process)



    1. Project settings are not able to close this window.

    2. Event handler for unexpected window: does not close this window with the settings mentioned in the first post.

    3. Event handler for timeout is not called! The event handler would kill the process "WerFault.exe", but the script is not executed.

    4. The test seems to hang (or is in some sort of endless loop) as there is no progress, it stays for hours within this testitem. If I stop the test I have to kill this window manually to make the test really stop.



    As this window is some system-window is there anybody having similar problems with such a window?

    Can anybody help me with this problem?



    thanks a lot in advance,



    Joachim
  • Joachim,

    As far as I know, TestComplete 8.70 can hardly handle such an error message generated by Windows OS, and the behavior you describe (the event handler for unexpected windows does not close the window, the test freezes, and so on) is expected.

    TestComplete 9.0 introduces a new crash and freeze diagnostics system and is able to track error messages generated by Windows OS. So, I guess, you can give TestComplete 9.0 a try and check if your unexpected error message is handled correctly.

    Also, could you please specify if that unexpected error message occurs only when you run automated tests with TestComplete? Does it occur if you try to interact with your tested application manually without launching TestComplete?

    In the first case, could you please contact our Support Team so they could investigate your problem and provide you with a solution? In the second case, that is, if the error message occurs even without TestComplete, I guess, you can contact the tested application's developers and notify them about the problem.

    Please let us know if you need anymore assistance.

    Thank you.
  • jsc's avatar
    jsc
    Regular Contributor
    Hi Julia,



    thank you for your answer!



    To your question:

    I havn't seen this error window when interacting manually with the application, until now the error just occurs when I use TestComplete.

    Unfortunately I cannot reproduce this problem. It occurs in different testitems, but if it occurs it's always while performing the same action (login in to the application).



    I tried TestComplete 9.0 yesterday and ran my tests this night, but the performance is that bad, that it is no alternative right now.



    Kind regards,



    Joachim
  • Joachim,

    If the error occurs only when you use TestComplete, please use this web form to send your test project and your tested application to our Support Team. This would help us analyze the problem and reproduce it.

    Thanks in advance.