Forum Discussion

gus's avatar
gus
Contributor
10 years ago
Solved

GeneralEvents_OnUnexpectedWindow not invoked?

 Hi, I seem to have some problem with unexpected window handling—in short, TC does not invoke my GeneralEvents_OnUnexpectedWindow event handler.   I have included a screenshot showing part of my ke...
  • AlexKaras's avatar
    10 years ago

    Hi,

     

    The OnUnexpectedWindow event is triggered only when TestComplete tries to perform some action over the tested application and this action is blocked by the modal window. That is, if your test code tries to .Activate, or .Click, or .Keys over some tested object and this is blocked by some other modal window, the OnUnexpectedWindow event will be triggered.

    Your code does not perform any UI-related actions (.SetText calls internal methods unlike the mentioned .Keys method) and thus the OnUnexpectedWindow is not triggered.