Skip to main content

Robot Task Activities - Text​

The Text activity types text into an application, either into the window that has focus or into a window or element it finds first.

The Text category in the activity list, with the Send Text activity


Send Text​

Types the text in InputText one character at a time. What the activity does first depends on which search properties are filled in:

  • Only ProcessName: the activity checks that the process is running, then types into the window that has focus. It does not give the process focus
  • ProcessName and WindowTitle or WindowHandle: the activity waits for the window, gives it focus and types into it
  • ProcessName, WindowTitle and one of Name, ClassName and AutomationId: the activity waits for the element, gives it focus and types into it
  • None of these: the activity types into the window that has focus

If the process, window or element is not found, the activity fails.

The Send Text activity with the Click to select an element link and the Text field

Click Click to select an element to pick the target in the UI and fill in the search properties.

Properties​

The Properties pane of the Send Text activity, with the Find Element, Input, Misc and Utils groups

Find Element

  • AutomationId: the automation ID of the element
  • ClassName: the class name of the element
  • Name: the name of the element
  • ProcessName: the name of the process that owns the window
  • Text: the text of the element. Supports the wildcards *, ? and #
  • WindowHandle: the handle of the window, when it is known. Default: "0"
  • WindowTitle: the title of the window. Supports the wildcards *, ? and #. Default: * (any window)

Input

  • Case: changes the case of the text before it is typed: "None", "UpperCase" or "LowerCase". Default: "None"
  • InputText: the text to type. The Text field on the activity sets the same value. A line break is typed as Enter
  • Mode: what happens before the text is typed. Default: "None"
    • "Overwrite": presses Ctrl+A and then Delete, which clears the field
    • "Append": presses Ctrl+End, which moves to the end
    • "InsertInFront": presses Ctrl+Home, which moves to the start
    • "None": types at the current position
  • TypingDelay: the wait in milliseconds before each character. Default: "100"

Utils

  • WaitForElement: how long to wait for the window or element, in milliseconds. Default: "10000"
  • Wait before and Wait after: the wait in milliseconds before and after the activity runs. When empty, the playback speed from the Robot Task settings is used

Tips​

  • Use "Overwrite" when filling in a field that may already hold a value, such as a form that is reused in each loop iteration. With "None", the text is typed at the current position next to whatever is there
  • Raise TypingDelay for applications that check or reformat input as it is typed. Text sent too fast can lose characters
  • Identify the target by AutomationId where the application has one. It is the most stable identifier and does not change when the window is resized or the layout changes
  • Fill in WindowTitle as well as ProcessName when the text must go to a specific window. With only ProcessName, the text goes to whichever window has focus
  • For text fields on a web page, use the Web Macro Populate Field activity instead, which finds elements by CSS selector or XPath. See Web Input - Element Path