Skip to main content

Target creation and controlling the automation progress

When you analyze the user interactions intended for automated, you must consider the amount of time a web page spends loading or waiting for an application to respond. Some applications load quickly, while others do not; numerous factors can cause this variance, such as time of day, the number of users, and background application processing.

When automating actions that interact with applications, ensure the target pages or windows and their controls are available before your automation sends data or responds to the controls' events.

Pega Robot Studio provides properties, methods, and events to determine if targets are available to be automated.

Created event

You can start an automated process by using the Created event of the application window. In the following example, the design block that represents a Created event is used as a starting point of the automation. When the target window associated with the frmAccountingApp control fully loads and displays, the Created event is triggered and starts the automation. 

Example of using Created event to trigger an automation
Note: The Created event for any target is triggered when the control is matched. Navigating back to a previous page or window retriggers the Created event for all interrogated objects on that page or window, which may cause the unwanted start of another automation.

WaitForCreate method

The WaitForCreate method sets up automation logic to wait until the Created event triggers for an object before proceeding to the next step of the automation. The method provides a Boolean result of the Created event. If the Created event occurs within the wait time, the automation continues through the True logic. If it does not occur within the wait time, the automation continues through the False logic. The Boolean logic provides the developer with an opportunity to manage the False logic with a custom message instead of relying on the system to generate an error. 

All objects have an implicit wait of 30000 milliseconds (30 seconds) by default. For example, if control is not available for the automation, the automation waits 30 seconds by default before it attempts to continue the automation. To change the default amount of waiting time, use the WaitForCreate (1 parameter) method, or adjust it by using the Timeout property on the control. 

For more information about advanced waiting logic, see Automation wait logic

In the following example, after logging in to the accounting application, an automation waits until the Created event occurs for the main application window. If the event triggers within 30 seconds, automation proceeds with the client search; otherwise, it notifies the user about the timeout.  

An example of using WaitForCreate method in automation

IsCreated property

When automating an application, an automation developer should uniquely identify UI elements across multiple application instances, just as a user does. If the UI element is correctly matched on the currently displayed application window or a webpage, the IsCreated property for this control equals true. The IsCreated property is read-only and cannot be modified in automation.

Unlike the WaitForCreate method, the matching status for IsCreated property is evaluated upfront, without waiting for an application to load or refresh.

Check your knowledge with the following interaction.


This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice