Using Wait for screen change action

Use Wait for screen change action in your automation to pause the execution of a script until a specific change occurs on the screen. This enables you to automate tasks that involve waiting for dynamic content to load or change before proceeding.

For example, a Human Resources (HR) personnel automating leave-management tasks wants to log in to the HR portal. After entering the user credentials, this action enables the automation task to wait until the next screen loads.

Procedure

  1. In the Actions palette, double-click or drag the Wait for screen change action from the Wait package.
  2. In the Screen change relative to field, choose Window or Screen.
  3. Select an application window:
    OptionSteps
    Application From the drop-down list, select the window title from the open applications.
    • The Window title field displays the title of the application window you have selected.

      Insert a wildcard character (*) in the Window title field to search for window titles that can change. You can specify one or more wildcards (*) at the start, middle, or end of the value. For example, to perform an operation on any window that has Microsoft in the title, use a wildcard to indicate any string by adding it before or after the value: *Microsoft*. The bot first searches for the exact window title (Microsoft), and if it does not find a match, it searches for windows with the term Microsoft anywhere in the title.

      You can use a regular expression (regex) to identify a window title. Select the regular expression condition as either String or a Pattern and then enter the value. By default, the Window title field is case-sensitive.

      To identify a browser title, you can enable the Case sensitive option to match the letter case, or disable the option to identify a window title where the letter case does not match.
      Note: Ensure that the minimum Bot Agent version installed on your system is the version that was released with Automation 360 v.26. If you have a Bot Agent version released with Automation 360 v.25 or earlier, then by default, the window title will be identified only with matching letter case (case-sensitive).
      For example, to match all window title names beginning with a word followed by - Notepad, you can enter the String value as * -Notepad, or use Pattern value as ((\w)\s)*document-Notepad for only those window titles that match this pattern.
      Note:
      • When you use a regular expression of type String with -title as the input value for a window title in any action, the bot might encounter a run time error. To prevent the run time error, ensure that when you add the string input as *-title, the application with the specific title is open. The asterisk (*) is just a character, not a wild card character.
      • When you use a regular expression of type Pattern with -title as the input value for a window title in any action, the bot might encounter a run time error because the input value *-title is incorrect.

        Ensure that you use valid regex patterns.

    • The Executable field displays the complete path of the executable file to identify the right window.
    Browser Select from a list of supported browser tabs.
    Note: This option supports Google Chrome, Chromium-based Microsoft Edge, and Internet Explorer browsers.
    Variable Use a window variable to specify the application window you want to use.
  4. Optional: Select the Resize window option to specify the window dimensions.
    This option delivers a more reliable bot. It resizes the window to the dimensions at which the task was recorded, which enhances the ability of the botto identify the target object.
    • If the window is maximized when you record the task, this option is not selected.
    • If the window is not at the maximum size when you record the task, this option is selected, by default, and the width and height fields are automatically filled with the dimensions of the window.
    Note: This option is available only for windows that can be resized. It is not available for the Desktop or Taskbar options.
  5. Click Capture region to select the area on the specific window.
    The selected window appears.
  6. Drag the mouse to draw a rectangle around the region that you want to capture and right-click when done.
    The captured area appears in the Preview section, followed by the image coordinates X, Y, Width, and Height.
    Note: After you capture the specific area, the action waits for the content in the captured area to change before executing the next action.
  7. In the How long to wait before comparing screens? field, specify the wait time (in seconds) to begin comparing the window or screen.
    When a difference is detected, the comparison stops and the task proceeds to the next action.
  8. In the How long to wait before screen comparing is stopped? field, specify the wait time (in seconds) for the screen to change.
    If the screen does not change within the time you specified, the task proceeds with the next action.
  9. Select the Throw an exception if the screen is not changed option to show an error message and terminate the bot if the screen does not change.
    If the option is deselected and the screen does not change, the task proceeds with the next action.
  10. Click Save.