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

Фотография

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


  • Авторизуйтесь для ответа в теме
В теме одно сообщение

#1 t.barabanov

t.barabanov

    Новый участник

  • Members
  • Pip
  • 2 сообщений
  • ФИО:Тимофей

Отправлено 17 октября 2011 - 14:55

TC 8.5
JScript
Web|Flash

В приложениее в некоторый произвольный момент может появиться диалог (пр-р. не найден ресурс). Есть ли возможность обнаружить и обработать подобное событие.
Слушатели событий OnUnexpectedWindow и OnOverlappingWindow при его появлении не сработали.
OnUnexpectedWindow - совсем
OnOverlappingWindow - Waiting until the overlapped window becomes visible сообщение во время выполнения скрипата. Слушатель не вызван.
  • 0

#2 t.barabanov

t.barabanov

    Новый участник

  • Members
  • Pip
  • 2 сообщений
  • ФИО:Тимофей

Отправлено 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
  ...
}

источник
  • 0


Количество пользователей, читающих эту тему: 0

0 пользователей, 0 гостей, 0 анонимных