Skip to main content

OCR Support

LastUsing reviewed:OCR Septemberrequires 21,tesseract 2026installed in Linux or Mac. See Service Suitefor more information.

Use OCR
only

when

doOcr(byte[] data) → String

Reads an image and finds the string in that image


doOcr(InputStream data) → String

Reads an image and finds the string in that image


doHtmlOcr(byte[] data) → HtmlPage

Reads an image and finds text cannotand bexy accessedposition throughof structuredthe page,texts API, or document data. OCR is useful for image-based validation but should not replace stable selectors or APIs.

guidance

  • Prefer DOM,

    doHtmlOcr(InputStream API,data) database,→ orHtmlPage extracted

    document

    Reads an image and finds text when available.

  • Use OCR for image/PDF/screenshot content that has no structured source.
  • Keep tolerances realistic because OCR can vary by image quality and font.
XY

Validationposition workflow

  1. Capture or provide a clean image source with sufficient resolution.
  2. Limitof the OCRtexts region to the smallest area that contains the expected text.
  3. Normalize extracted text before comparing it with expected values.
  4. Use assertions that tolerate acceptable whitespace or punctuation differences.
  5. Review failures with the original image attached so false negatives can be diagnosed.

Note: OCR-based tests can be fragile. Use them as a fallback or targeted validation, not as the primary locator strategy.


Last updated: SeptemberJuly 21,03, 20262023

If you have any feedback on this topic, please contact us at documentation@appvance.ai.