### Find text

The **Find text** building block searches for a piece of text on the entire screen or within a defined Area. It is commonly used to validate that the system under test is in the expected state before deciding to pass, fail, or branch the flow.

See the [Capture text on screen lesson](/content/learn/text-numbers-virtual-desktop-automation/index.html) for an example of how to use the Find text block.

Fully expanded, the **Find 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

1. Drag **Find text** onto the canvas.
2. Connect the block in the flow and specify **Text to find**. Optionally set **Language**, define an **Area** (or leave it empty to search the whole screen), and adjust **OCR** ([OCR Selection Guide](https://docs.leapwork.com/leapwork-studio/latest/working-with-leapwork/ocr-engine-selection-guide)), occurrence, scrolling, and timeout-related settings if needed.
3. 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 found. 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 find**: Defines which text to search for. 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 find** 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.

- **Area**: Limits where the block searches for text using **X, Y, Width, Height** coordinates, starting from the upper-leftmost pixel. If no area is defined, the entire screen is searched.

- **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 occurred**: Selects which occurrence of the text on screen to use if more than one match is found.

- **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**. Default value is **20 seconds**.

- **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.

- **Await not found**: When enabled, the block assumes the text is currently present and waits until it can no longer be found before proceeding.

## Resources

| **Topic** | **Description** |
| --- | --- |
| [Flows FAQ](https://docs.leapwork.com/faq/latest/leapwork-flow-faq/flows-faq) | Common questions about creating, running, and managing flows in Leapwork. |
| [Flows Troubleshooting](https://docs.leapwork.com/troubleshooting/latest/leapwork-flow-troubleshooting/flows-troubleshooting) | Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork.
