Activities
latest
false
Banner background image
UI Automation Activities
Last updated Mar 18, 2024

OCR Text Exists

UiPath.Core.Activities.OCRTextExistsWithBodyFactory

Checks if a text is found in a given UI element or image by using OCR technology.

Properties

Input
  • Text - The string you are searching for.

    Note: All strings have to placed between quotation marks.
  • Occurrence - If the string in the Text field appears more than once in the indicated UI element, specify here the number of the occurrence that you want to find. For example, if the string appears 4 times and you want to find the first occurrence, write 1 in this field. The default value is 1.
  • Target.Element - Use the UiElement variable returned by another activity. This property cannot be used alongside the Selector property. This field supports only UiElement variables.
  • Target.ClippingRegion - Defines the clipping rectangle relative to the UiElement.
Misc
  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
  • Target.Selector - Text property used to find a particular UI element when the activity is executed. It is actually a XML fragment specifying attributes of the GUI element you are looking for and of some of its parents.
  • Target.TimeoutMS - Specifies the amount of time (in milliseconds) to wait for the activity to run before the SelectorNotFoundException error is thrown. The default value is 30000 milliseconds (30 seconds).
  • Target.WaitForReady - Before performing the actions, wait for the target to become ready. The following options are available:

    • None - Does not wait for anything except the target UI element to exist before executing the action. For example, you can use this option if you want to retrieve just text from a web page or click a particular button, without having to wait for all UI elements to load. Note that this may have unwanted consequences if the button relies on elements which are not yet loaded, such as scripts.
    • Interactive/Complete - Waits all of the UI elements in the target app to exist before actually executing the action.

      To assess if an application is in the Interactive or Complete state, the following tags are verified:

    • Desktop applications - A wm_null message is sent to check the existence of the <wnd>, <ctrl>, <java>, or <uia> tags. If they exist, the activity is executed.
    • Web applications:
    1. Internet Explorer - The <webctrl> tag is used to check if the Ready state of the HTML document is set to Complete. Additionally, the Busy state has to be set to "False".
    2. Others - The <webctrl> tag is used to check if the Ready state of the HTML document is Complete.
    • SAP applications - First the presence of the <wnd> tag verified, after which a SAP specific API is used to detect if the session is busy or not.
Output
  • Exists - Indicates if the text exists or not. The field supports only Boolean variables.
Common
  • DisplayName - The display name of the activity.

Example of using the OCR Text Exists activity

Here you can see how the OCR Text Exists activity is used in an example that incorporates multiple activities.

  • Properties
  • Example of using the OCR Text Exists activity

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.