Open topic with navigation
Troubleshooting OCR issues
Optical character recognition (OCR) technology is not exact. The following tips can help you successfully use OCR in QA Wizard Pro.
- Use the test computer the script will run on to record scripts and add or debug OCR statements. Changes to the test environment, such as different screen resolutions, web browsers, or Windows themes, may affect the region where graphical text is found and cause playback errors.
- When using OCR statements in web scripts, do not resize the browser window in the during recording because it can change the location of graphical text and cause playback errors.
- OCR recognizes a wide variety of fonts, but it may not accurately read all fonts.
- OCR best recognizes horizontally aligned text. OCR may incorrectly read or convert text positioned vertically or at an angle.
- OCR best recognizes dark-colored text on a contrasting background (e.g., black text on a white background). OCR may not recognize white or light-colored text, especially on a light-colored background. You can change the default amount of contrast OCR uses or add the OCRSetContrast statement to scripts to adjust it during playback. See Setting playback options and OCRSetContrast.
- Use the SaveRegionToImageFile statement to capture a screenshot of the region OCR reads text from if OCR statements fail. You can use this screenshot to review the graphical text and change the region to return text from. See SaveRegionToImageFile. After verifying the region is correct, use the OCRGetTextFromFile statement to check the text returned from it. See OCRGetTextFromFile. If the text is incorrect, you can use the OCRConvertToGrayscale, OCRSetContrast, and OCRSetScale statements to adjust the settings used for OCR. See OCRConvertToGrayscale, OCRSetContrast, and OCRSetScale.
- QA Wizard Pro uses the Tesseract OCR engine. QA Wizard Pro includes the English language file (eng.traineddata). If you need to test other languages, download additional language files from Tesseract. Language files must be stored in a directory named tessdata. You can then change the default OCR language file or add the OCRSetLanguageFilePath statement to scripts to specify the language file to use during playback. See Setting playback options and OCRSetLanguageFilePath.