Although pauses can be hardcoded using the Pause advanced command, there are several ways to wait for events to happen in a more intelligent way. This article will outline how to use smart waits in Kryon RPA so that the your robot is not left waiting unnecessarily when running a wizard.
Prerequisites: None.
Wait for Window to Appear
Wait for Object to Appear
Wait for Busy Cursor
Introduction
Although the Pause advanced command can be useful, especially when developing and debugging a wizard, in this article we’ll be talking about "smart wait" methods. These are dynamic rather than hardcoded wait methods that progress an automation as soon as possible whilst only doing so once a condition is met.Wait for Window to Appear
Kryon Studio has built-in functionality that will wait for the window in the recording to appear. This is based on any combination of window data set in this section:
- Window Data - URL/Page/Query/Caption for web pages, Class Name/Caption for desktop applications.
- Visual Objects - will wait for an image or text to appear on the screen, uses Kryon's visual algorithm.
- Text Objects - will wait for "native" text to appear on the screen (supported by Internet Explorer and Win32 desktop applications only).
- HTML Objects - will wait for a HTML element to appear on the screen (supported only in web pages)
Info: The default is 3 seconds, but this can be customized by updating the application definition in Kryon Admin, or in Studio via the menu bar at Tools >Application Settings
Wait for Object to Appear
Similar to the Wait for Window to Appear option, the Wait for Object to Appear option does just that; it waits for the detected object in the recording to appear before continuing. Again, the time to wait can be set to any number of seconds and applies to both applications and web pages. When the wizard is running, it will wait up to the amount of time set, but if the object appears before that set time, the wizard will continue.This functionality can be found in the Flow tab in Normal View when editing a wizard. Double-click the core action, then click on the crosshair icon. There, you will see the Wait for Object to Appear option.
Info: The default is 1 second, but this can be customized by updating the application definition in Kryon Admin, or in Studio via the menu bar at Tools >Application Settings
Wait for Busy Cursor
The Wait for Busy Cursor advanced command instructs the wizard to wait for a cursor to stop indicating that the system is busy before performing the next step. The icon that a mouse cursor could display during this time can be different depending on your operating system settings. The most common icon is an hourglass or spinning circle or wheel.
The Wait for Busy Cursor advanced command has no configurable options and can be added to a wizard simply by dragging it into the editor in Advanced Commands view.