Thursday, July 3, 2008

Winrunner - SET_WINDOW and WIN_ACTIVATE

This is one of my favorite and Expert questions in Winrunner.

  1. What is the difference between "set_window" and "win_activate"?
  2. When would you use "set_window" and when would you use "win_activate"?

win_activate has the syntax win_activate(window);. The win_activate function
makes the specified window the active window by bringing it into focus and
raising it to the top of the display. (It is the equivalent to clicking on the
window banner)

Set_window has the following syntax: set_window(window,[time]);
The set_window function directs input to the right application window. This
directs the GUI map to this window. It also sets the scope for object
identification in the GUI map.

The most important difference is that set_window has a timing option.
WinRunner will wait a maximum of the number used in the function, PLUS the system set timeout, to wait for the window to appear. Win_activate assumes the window is already on the desktop and has no timing option.

No comments: