OCR Support
LastUsing reviewed:OCR Septemberrequires 21,tesseract 2026installed in Linux or Mac. See Service Suitefor more information.
Use
OCR
only
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.
Recommended
guidance
PreferDOM,doHtmlOcr(InputStream
API,data)database,→orHtmlPageextracteddocumentReads 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 qualityandfont.
Validationposition workflow
Capture or provide a clean image source with sufficient resolution.Limitof theOCRtextsregionto the smallest area that contains the expected text.Normalize extracted text before comparing it with expected values.Use assertions that tolerate acceptable whitespace or punctuation differences.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.