DesktopAutomation.ActivityLibrary.TextExistsActivity
Description
Looks for a specific text from an Element and returns True if it exists and False if it does not.
Properties
Output
Exists - True if the text exists on an element and False if it does not.
Input
Occurrences - The value of which the number of occurrences of would be checked in order to find the Text.
- Text - Text to be searched.
Common
ContinueOnError - The Boolean value to specify whether to continue executing the next activities even if there is an error thrown on this activity.
DelayAfterMs - Duration in milliseconds to delay before moving to the next activity.
DelayBeforeMs - Duration in milliseconds to delay before pushing this activity to the selected element.
Misc
DisplayName - Renames the activity.
Target.Element - Use UIElement variable. This property cannot be used together with Selector.
Target.Selector - Property used to find a specific UI Element when the activity is executed.
- Target.WaitElement - Waits for an Element to be ready before the activity runs if COMPLETED is chosen. Does not wait for an Element if it is set as NONE.
Target.TimeoutMS - Duration in milliseconds to send an error if the selected element is not located.
Example
- Create a Boolean variable called textExists.
- Add a Text Exists activity, and in the Exists field under Properties, add textExists.
- Click Select Element on Screen and select the element where the text would be checked if it exists or does not.
- In the Text field, write "Robotic process automation".
- Add an If activity, and in the Condition field, write textExists.ToString.Equals("True").
- Inside Then, add a Write Line activity, and in the Text field, write "Text Found".
- Inside Else, add a Write Line activity, and in the Text field, write "Text Not Found". The use case should look as the following screenshot.
The output depends on the selected element in Text Exists activity. If the specified text exists, the activity inside Then should be executed. Else, the activity inside Else should be executed instead.