Checking Text in an image - Use-case scenario
Relevant for: GUI tests and scripted GUI components
Ben and George are quality assurance engineers who are experienced OpenText Functional Testing users. George is also familiar with text recognition and has a basic understanding of how text recognition mechanisms work.
Ben often uses bitmap checkpoints to check the appearance of various icons or pictures in the user interface he is testing.
For one of his projects, Ben also needed to verify the text in the graphics, so he decided to use text checkpoints.
Ben decided to begin the verification process by inserting a text checkpoint to check that the text Welcome ! was displayed correctly in the following graphic.
Before inserting the text checkpoint, Ben opened the Text Recognition pane and configured the text recognition settings. Ben also knew that single text block mode usually works best, so he selected the Single text block mode option.
Ben then inserted a text checkpoint on the entire area shown above and received the following results in the Text Checkpoint Properties dialog box:
Ben noticed that there were extra characters in the Checkpoint Summary area of the text checkpoint, but he did not know why.
Ben asked his colleague, George, for help. George explained to him that the text recognition mechanism sometimes adds extra characters to the text checkpoint when it does not recognize the text correctly.
George also pointed out that the area Ben defined for the text checkpoint consisted of multiple text blocks because the text was not uniform in font size, color, or background. The title area consisted of white characters on a blue-gray background, while the remaining text was smaller and consisted of blue text on a white background.
Ben remembered that he had selected the Single text block mode option in the Text Recognition pane (Tools > Options > GUI Testing tab > Text Recognition node) and understood that if he wanted to use single text block mode, he would have to create a text checkpoint only on the Welcome ! area of the graphic, and not on the entire graphic. Ben tried this, and the OCR mechanism correctly identified the text, as shown below:
Ben was pleased with the results, but he wanted to explore other possibilities, so he inserted another text checkpoint—this time on the entire graphic. He selected the Multiple text block mode option in the Text Recognition pane, which resulted in the following:
Ben was pleased that the OCR mechanism correctly recognized all of the text in the graphic. But he needed to check only the title, Welcome !, so he finalized this checkpoint by marking all of the text after Welcome ! as Text After.
Even though both checkpoints passed, Ben needed only one text checkpoint. He decided to keep the first checkpoint (that used Single text block mode), and he deleted the second one. He selected the Single text block mode option in the Text Recognition pane to help ensure that the checkpoint would pass in future run sessions.