In certain cases, a user might want to handle a popup window which pops up unexpectedly (e.g. a timeout notification), or a popup which causes an action to hang indefinitely (e.g. a confirmation popup when trying to delete an Excel worksheet).

Since, by their nature, the above cases cannot be handled as usual, additional steps should be taken in addressing them.

An effective solution would be to have a secondary Process which will be running in the background, waiting for the popup window to appear, so that it can be handled without interrupting the main process. Consider the below setup:

Main Process:

Secondary Process:

Using the above setup, the main Process will begin by starting the secondary (Popup Monitor) Process; it then proceeds to execute its code as usual, and finally stops the secondary Process.

The secondary Process is simply an infinite loop, in which we look for a popup window and handle it accordingly.

In the Main Process > Action 6, instead of clicking on the "Stop Process" element of the secondary Process, we could alternatively use the WinAutomation Controller to achieve the same functionality in a non interactive way. Check the topic "Controlling WinAutomation from the command line" in the Help File.

This setup will work well in the first scenario, where we have an unknown number of occurrences of a popup window appearing randomly. This solution can be modified, of course, to suit the needs of any process; adding a specific number of occurrences, running the secondary Process exactly at the moment when it is needed, removing the last step of the main Process etc.