Browser Window Actions
A window holds HTML, XML or other content in a robot. One or more windows are always open, and one window is the current window, i.e. the window containing the page that a step-action works on. In Design Studio, each window is displayed in a tab, and the current window is marked with a yellow rectangle.
Windows allow you to handle multiple pages simultaneously. Note, however, that a step can only work on a single page at a time, so you need to change the current window whenever you want to work on another page than the current one.
Using the appropriate steps in a browser window, you can:
- Open a new window using the New Window action
- Set the current window using the Set Current Window action
- Close a window using the Close Window action
In Design Studio, an easy way to insert a Set Current Window step is to right-click on the window's tab and choose Set as Current Window.
When loading a page that loads other pages (e.g. a page containing a <frameset>-tag), each page will automatically be loaded into a separate window.
Each window can have one or more named tags or ranges. Note that each named tag or range belongs to a specific window.
Identifying a Window
Some steps (for example the ones mentioned above) are configured to operate on a particular window. The window may be identified in three ways:
- by its name as displayed in the window's tab or by the number of the window's tab
- by the found tag
- by a pattern matching against the windows name.
The name is the more stable of the two alternatives in face of robot changes, and also (most subtly) when a step may be reached via different paths that open different windows. Thus the name is the preferred way to identify a window. Matching does not work on windows showing variables, because the names of these are fixed.
In some cases, however, the name is not the same every time the robot is run. For example, some websites are based on frames but name these frames differently each time (while keeping the structure of the frame set). Because the window name is derived from the frame's name, the window name is not much use in such a case, and the windows must be referenced by their numbers. In these situations, it is important to make sure that every path through the robot that can lead to the step in question results in the same window structure and window numbers.
You can also use tags to identify a window. The found tag must be a FRAME, IFRAME, OBJECT or EMBED element. In Design Studio, the list of frames is displayed as a tree in the Frames View. Use the "Window #<number> (Window or Frame)" option in the Set Current Window action to set the current window by the found tag.
There are two alternative ways of identifying a window:
- Specifying a pattern for the window name
- Specifying a pattern for the (text or HTML) content of the window