Forum Discussion
AlexKaras
16 years agoCommunity 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.
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.