Forum Discussion

ashu's avatar
ashu
New Contributor
16 years ago

dont recognizing as the unexpected window.

Hi,



We recently purchased Test Complete 7 and I am having trouble with the recognizing Unexpected Window. while running My application through TC when my application crashes it is not recognizing it as unexpected window and it keep running behind. but because fo app. crashes it donot get the control further and start giving log error(object not found). plz suggest how to handle that crash window that can pop up anytime. or if there is anyway to make it as unexpected window.



Ashu 

6 Replies


    1. Right click on project name in Project Explorer > Item "Edit" > Item "Properties" (see attach Step1)

    2. On right panel, choose node "Playback" and uncheck all checkbox in "On unexpection window" and check only "Stop Execution" (see attach Step2)




    Then, when your app will be crashed, handle that crash window in name mappinig



    That is all



    GL HF :)


  • AlexKaras's avatar
    AlexKaras
    Community Hero
    Hi Ashutosh,



    As per its description in the TestComplete help file, the window is considered to be unexpected only if it blocks visual interaction with another window.

    For example, consider tested application App1 with the window Window1. If the Window1 is overlapped with the modal message box window (e.g. App1.msgBox) and your code tries something like App1.Window1.Activate (or App1.Window1.Keys("aaa") ), then the App1.msgBox window will be recognized as an unexpected one.



    However, if in the same situation your code will be like this:

    App1.msgBox.Close

    App1.Window1.Activate

    the OnUnexpectedWindow event will not be triggered because the code deals with msgBox explicitly and this assumes that msgBox is the expected window.



    Also note, that if the msgBox window is open, the following line

    App1.Window1.WndCaption

    will not trigger the OnUnexpectedWindow event because there is no user interaction with the blocked Window1 window.



    In your case, the crush dump window is shown by another process (dw20 or the like) and does not block anything. That is why the OnUnexpectedWindow event is not triggered.



    One of possible ways to handle this is to implement the OnLogError event handler and check in the handler if the tested application process and crush window exist.
  • ashu's avatar
    ashu
    New Contributor
     @ Nikita:  I have done the same but its not recognizine it as unexpected window. see the attachments



    @alexei : i have tried to handle it as event but its not being called. see the attachments



    Sub GeneralEvents_OnTimeout(Sender, Params)

    Call crashCheck

    End Sub

    Sub GeneralEvents_OnLogError(Sender, LogParams)

    Call crashCheck 

    End Sub


     

  • AlexKaras's avatar
    AlexKaras
    Community Hero
    Hi Ashutosh,



    I believe that you not only created the event handling routines but attached them to the relevant events as per "Handling Events With TestComplete" help topic, didn't you?



    Also, was it script code or keyword test running when the event handlers were not triggered?
  • ashu's avatar
    ashu
    New Contributor
    hi Alexei



               I am using Script code. actually i didn't hv attached the event. now  event "OnlogError" is being triggered but this is not the correct   way  i  suppose, it will be triggered for all log errors but as if now its fine. anyway thanks for ur support :).



             Actually when the crash window comes the running application hangs up so it (TC) cant access any controls further. n start putting error log. i have seen the there is the entry for crash window(which i want to be treated as unexpected window) in Name mapping. is this the reason it doesnot reognize it as unexpected window??.

                
  • Hi,



    If your application displays a crash dialog, try using the solution posted here.



    Also, you can use Freeze Diagnostics (see the "Diagnosing Application Freezes" help topic).