Wait Activities

The Wait activity puts on hold the current activity for a specified amount of time before moving on to the next activity. It is useful for ensuring screen elements are fully loaded and for detecting UI changes.

The overall duration of the automation will be lengthened by adding the Wait activity. The different types of wait activity are as follows:

Wait (Screen)

Purpose

Use the Wait (Screen) activity until a screen is visible and fully loaded, and then call a callback. If the screen already exists, the callback is called immediately. Otherwise, it calls the callback on reception of a LOAD event on the screen.

Best Practice

Ensure that the screen is fully loaded before doing any activities especially when the Start Screen activity is used.

Use Case Example

In the following example of an UI automation application, you start a screen and then include the Wait (Screen) activity. This activity ensures that the automation waits the necessary time until the screen starts and is fully loaded before interacting with it.

Wait Close (Screen)

Purpose

Use the Wait Close (Screen) activity to wait until a screen is closed, and then call a callback. If the screen doesn't exist, the callback is called immediately. Otherwise, it calls the callback on reception of an UNLOAD event on the screen.

Best Practice

Use this activity if the automation needs to wait for a human to interact by closing the screen.

Use Case Example

In the following use case example of a simple automation to connect on SAP Logon, you choose the Wait Close (Screen) activity at the end to ensure that the automation waits for you to manually close the page and then proceeds with the workflow.

Wait (Element)

Purpose

Use the Wait (Element) activity until a screen element is present and loaded, and then call a callback. If the screen already exists, the callback is called immediately. Otherwise, the automation will begin repeatedly polling the application until it sees that the element exists.

If you use the Get Element activity on an element in an application, the SAP Intelligent RPA will add the Wait (Element) activity automatically.

Best Practice

Use this activity if your automation has issues while recognizing some UI Elements. In some cases, the Must Exist activity can be added to ensure the existence of an element.

Use Case Example

In the following use case example of the SAPUI5 automation, you use the Wait Element activity because you open a tab inside the existing screen. This activity ensures that the tab and the element on the tab are present, and then you can manage different activities on it, such as the Get Element activity and so on.

Wait Change (Element)

Purpose

Use the Wait Change (Element) activity until the content of a given UI element is changed.

Best Practice

Use this activity for detecting UI changes and readiness rather than using the fixed wait activity.

Use Case Example

In the following use case example of the SAPUI5 automation, you use the Wait Change (Element) activity until the initial text value of the element is changed, and then you can add different activities on it, such as the Get Element activity and so on.

Wait Ready

Prerequisites

For C4C application, the version of UI5 application must be greater than 1.60 to support the Wait Ready activity.

Purpose

Use the Wait Ready activity to keep the runtime execution in wait mode when the screen is in a busy-wait state.

Best Practice

From the SDK version 1.18 or higher, the Wait Ready activity is integrated inside the SDK activities by default; therefore, it is not mandatory to add the Wait Ready activity explicitly between two intermediate UI5 activities.

Use Case Example

In the following example of the automation (purchase order item) with the SAPUI5 application, you add the Wait (Screen) activity to check if the screen is loaded. Then, you add the Wait (Element) activity to check if the element is present on the screen. After setting the value for the Order Type element, you add the Wait Ready activity to check if the next Set – Sales Organization action is performed. Similarly, you add another Wait Ready activity after the Set – Sales Organization activity to check if the next Set – Distribution Channel action is performed. Thus, you must add the Wait Ready activity between two intermediate UI5 activities to check the action of every UI5 element individually.

Wait Until Screen Responds

Purpose

Sometimes Windows applications take a long time to respond. For example, when you click a button and so on. Now, if the automation proceeds to the next step, it can get stuck or fail because the host application doesn’t respond, and thus, it cannot be reached. To make the host application responsive, you can loop it in the workflow of the automation. However, this approach might not work since the connector fails to contact the host application, and the application doesn’t load.

To overcome these complexities, use the Wait Until Screen Responds activity to wait until the screen is responsive and the element is accessible on the screen.

About the Activity

Wait Until Screen Responds: This activity provides you a simple way to wait for a Windows application until it becomes responsive, and the element gets accessible on the screen. The activity is only applicable for the UI Automation.

This activity takes input parameter as a screen element and the timeout value you want to define. First, this activity waits for the application to become responsive. During this time, the host application is not contacted and hence, it doesn’t get stuck. Once the application is responsive, the input element becomes accessible on the screen. The activity gets timeout if:

  • the application doesn’t respond

  • the element is not found

Input Parameters:

  • Target: This parameter defines the element on the screen to wait for once the screen is responsive.

  • Timeout: This parameter defines the total time to wait for the screen to respond and then the element to appear.

Contextual Filtering:

A separate module is available for the UI Automation inside the Core SDK. The Wait Until Screen Responds activity is added to this module. Therefore, this activity is specific only to the UI Automation and it won’t be visible to any other technology other than the UI Automation. Therefore, the contextual filtering also works for the Wait Until Screen Responds activity.

All the existing activities remain in the Core SDK to ensure backward compatibility.

Best Practice

Use this activity to wait until the screen is responsive and the element is accessible on the screen.

Use Case Example

In the following example of the automation, you add the Wait Until Screen Responds activity to to wait until the screen is responsive and the element is accessible on the screen.