STC Protector
When creating a Workflow that needs to run stably and robustly for long periods, pop-up windows can be difficult to handle. Mostly they appear irregularly, so it is not easy to implement them into a static Workflow.
To handle these pop-ups, you can use STC Protector. Think of it as a process running parallel to your actual measurement Workflow, checking if any window appears onscreen, and then closing it in an instant by sending a predefined keystroke sequence.
Properties
-
Pause between keystrokes, ms Define how long the Robot should pause between each keystroke sequence
-
Use regular expression for window title You can further distinguish between window titles by selecting this checkbox. For a short introduction to regular expressions, see Using Regular Expressions.
-
Use window text Defines if, in addition to the window title, window text should also be used to identify the window that the keystrokes should be sent to
-
Window check type Sets whether the protector reacts if a window merely exists or if it has to be active to be handled by STC Protector.
Wizard
Click Start to begin recording the keystroke sequence for handling pop-up windows. Select the pop-up window with the mouse and press the combination of keys needed to close it. When you are finished, click Stop. A new line for this window will appear in the STC Protector wizard.
The pop-up windows are identified by the window title. Make sure only one line exists for each window title!
You can also add pop-up windows that are not actually onscreen. Use the + button and enter the window title and the combination of keys needed to close it.
Some applications open pop-up windows that have the exact same title as the main application. In this case, the STC Protector cannot decide which window should be handled by means of the title alone. To avoid this problem activate Use window text before clicking Start. Now STC Protector will use text displayed in the window and not only its title to decide whether it is a pop-up window to be closed.
You can also distinguish between window titles by using the checkbox Use regular expression for window title. This function is described in detail in Section Using Regular Expressions.
Example
When there is more than one tab opened in Internet Explorer, the program asks you if they should all be closed when you wish to exit the application. This question is displayed in a pop-up window.
Now, during execution, when the pop-up window appears, the STC Protector will automatically send the Enter keystroke to it and thus close the window.
To ensure that the window is closed as quickly as possible (to avoid any interference with the measurement), leave the Pause between keystrokes setting at "0".
Troubleshooting
In extremely rare cases, the Workflow seems to stop and do nothing more after a pop-up window has been handled. This might be the case when the window is not actually closed by the given keystroke sequence, but the main application hides it completely from the desktop without removing the window handle from the operating system. In such cases, try setting Window Check type to Active.