Перейти к содержимому

t.barabanov

Регистрация: 17 окт 2011
Offline Активность: 25 окт 2011 19:33
-----

Мои сообщения

В теме: Как поймать и обработать неожиданное окно flash.

25 октября 2011 - 19:36

Remarks

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.
To handle unexpected windows in Flash, Flex and CLX applications, use the WaitWindow or FindChild method to check if a modal window appears after your test performs actions that can lead to this. The following code snippet demonstrates this:

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
  ...
}

источник