Sometimes, when QuickTest Professional (QTP) 9.2 attempts to capture text from a small object or in a small text area, it is not captured, or is captured incorrectly.
Modify the maxHforSingleBlock and maxWforSingleBlock values for the text recognition registry key
Note: Solution is not available for earlier versions of QuickTest Professional, only versions 9.2 and above
Specifying the maximum text area size in pixels may help improve text recognition. This causes the OCR mechanism to focus on a specific area and treat it as a single text block (and not as multiple text blocks, as it would normally do).
To specify the maximum text area size for QuickTest Professional’s OCR text recognition, update the OcrEngine registry key.
1. Open the registry editor.
2. Navigate to HKEY_CURRENT_USER\SOFTWARE\Mercury Interactive\QuickTest Professional\MicTest\OcrEngine. 3. Right-click on the maxHforSingleBlock value, and select “Modify.”
4. Set the value data to the desired height of the text block in pixels, for example, 29.
Tip: Is possible to use QuickTest Professional’s Object Spy to find the height and width of the object.
5. Click .
6. Right-click on the maxWforSingleBlock value, and select “Modify.”
7. Set the value data to the desired width of the text block in pixels, for example, 29.
Tip: Use QuickTest Professional’s Object Spy to find the height and width of the object.
8. Click .
9. Restart QuickTest Professional.
Modify both value entries to instruct the OCR mechanism to treat the object as a single text block.
Note: The default for both values is zero (0), which indicates multiple text blocks.