Currently, TestComplete does not handle the following window types as unexpected:
- Modal windows in Flex applications (for example, those created using the PopUpManager class).
- ActionScript errors displayed by Flash Player.
- Unexpected windows in Delphi and C++Builder CLX applications. This is due to specifics of the CLX library implementation: an application’s window can be activated even when a modal dialog is displayed. Because of this behavior, TestComplete does not treat modal CLX windows as unexpected ones.
JScript
function Test() { var p, unexpWnd; p = Sys.Process("MyApplication"); // Do something ... // Handle possible unexpected window unexpWnd = p.WaitWindow("QWidget", "Error", -1, 1000); if (unexpWnd.Exists) { // Post the window image to the log Log.Picture(unexpWnd.Picture(), "Unexpected window detected."); // Close unexpected window unexpWnd.Close(); } // Continue testing ... }
источник