Select Text | Leapwork Docs
The Select text building block searches for a piece of text on the entire screen or within a defined Area, and then selects it with the mouse cursor. It is commonly used when you need to select text before copying it to the clipboard or using it in later steps.
See the Capture text on screen lesson for examples of how to use the Select text block.
Fully expanded, the Select text block shows the following properties:
Note: The screenshot on this page uses the Elegance Design, introduced in 2025.3. If you are using an earlier version, your layout may look different.
Quick-start
- Drag Select text onto the canvas.
- Connect the block in the flow and specify Text to select. Optionally set Language, define an Area (or leave it empty to search the whole screen), set Speed, and adjust OCR, occurrence, scrolling, and timeout-related settings if needed.
- Run the flow when it’s ready.
Building block parameters
Parameters
Block header: The green input connector triggers the block to start executing. The green output connector triggers when the text has been selected. If Use occurred is set to All, this output connector triggers on each iteration until all occurrences are iterated through. You can rename the block by double-clicking the header text and typing a new title.
Text to select: Defines which text to search for and then select with the mouse cursor. The text can be dynamic by inserting tokens from Text fields. To insert a token, right-click in the field and select Insert token.
Text fields: Stores key–value pairs that can be inserted as dynamic tokens into Text to select via Insert token.
Language: Selects the language used when recognizing the text.
Not found: Triggers if the text is not found before the timeout behavior completes. This is typically used to branch execution flow or explicitly fail a case by linking it to a Fail block.
Position found: Outputs the screen position where the text was found as X, Y coordinates. The top-left corner of the screen is 0, 0.
Area found: Outputs the screen area where the text was found as X, Y, Width, Height, starting from the upper-leftmost pixel. The top-left corner of the screen is 0, 0.
Area: Limits where the block searches for text using X, Y, Width, Height coordinates, starting from the upper-leftmost pixel. The top-left corner of the screen is 0, 0. If no area is defined, the entire screen is searched. You can enter values manually or right-click and select Capture area.
Speed: Controls how quickly the mouse selection is performed when selecting the found text.
Is case sensitive: Controls whether text recognition should be case sensitive. By default, it is case insensitive.
Engine: Selects the OCR engine used for text recognition. Supported options include OCR 1.0, OCR 2.0, and ABBYY.
OCR Mode: Selects the OCR recognition strategy.
- Full mode: Runs four recognition tries in parallel using two different modes (two normal and two inverted colors).
- Fast speed: Runs two recognition tries in parallel (one normal and one inverted colors).
OCR Precision: Controls how strict OCR recognition is on a character level. Higher precision requires higher confidence before a character is accepted, which can reduce false positives but may also miss characters.
- High: Highest confidence/precision. Predefined value is 70.
- Medium: Medium confidence/precision. Predefined value is 50.
- Low: Low confidence/precision. Predefined value is 30.
- Very Low: Lowest confidence/precision. Predefined value is 20.
- Custom: Sets a custom confidence value from 0–100.
Use dirty edge mode: Use this when the text is on a textured background or close to a visual border element.
Use occurred: Selects which occurrence of the text on screen to use if more than one match is found. Select All to iterate through all occurrences.
Current index: Outputs the current index while iterating through all occurrences of the text.
Completed: Triggers when iteration through all occurrences has completed.
Default timeout: Controls whether the block uses the default timeout from the flow settings or a custom timeout value.
Timeout (sec): Sets the maximum time spent searching for the text before the block gives up and triggers Not found.
Scroll to find: Controls whether the block scrolls while searching for the text.
Max repeats: Sets the maximum number of scroll attempts before the block stops searching.
Amount: Sets how much scrolling is performed on each repeat.
Delay (sec): Sets the delay in seconds between each scroll amount.
Await no movement: Delays the search until there has been no movement on the screen for a specified period.
Resources
| Topic | Description |
|---|---|
| Flows FAQ | Common questions about creating, running, and managing flows in Leapwork. |
| Flows Troubleshooting | Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork. |