Verifies graphical text against an expected value through OCR comparison. Use to verify text in images, control types QA Wizard Pro cannot recognize, or a specified region in a window or control. See Creating OCR checkpoints.
If the expected text does not match the application during playback, the script fails or continues and displays a message in the Errors pane. For example, if the accuracy percentage is 84% and the accuracy calculated during playback is 80%, the checkpoint fails.
Syntax
OCRCheckpoint(MinimumAccuracy, "ExpectedText", LeftEdgePixel, TopEdgePixel, RectangleWidth, RectangleHeight, FailureBehavior, "Warning")
Arguments
Argument | Description |
---|---|
MinimumAccuracy | Minimum percentage of accuracy required to pass the checkpoint. |
ExpectedText | Text string to verify against the returned text. |
LeftEdgePixel | Optional integer pixel value of the left side of the rectangle that contains the text to verify. If not specified, text in the entire window or control is used. Required if the TopEdgePixel, RectangleWidth, or RectangleHeight argument is specified. |
TopEdgePixel | Optional integer pixel value of the top side of the rectangle that contains the text to verify. If not specified, text in the entire window or control is used. Required if the LeftEdgePixel, RectangleWidth, or RectangleHeight argument is specified. |
RectangleWidth | Optional integer pixel value of the width of the rectangle that contains the text to verify. If not specified, text in the entire window or control is used. Required if the LeftEdgePixel, TopEdgePixel, or RectangleHeight argument is specified. |
RectangleHeight | Optional integer pixel value of the height of the rectangle that contains the text to verify. If not specified, text in the entire window or control is used. Required if the LeftEdgePixel, TopEdgePixel, or RectangleWidth argument is specified. |
FailureBehavior | Optional failure behavior. True stops the script if the checkpoint fails. False displays a warning and continues playback. If not specified, True is used. |
Warning | Optional message to display in the Errors pane and run report when checkpoints fail. |
Supported objects
Browser, Button, Calendar, Cell, CheckBox, ColumnHeader, ComboBox, ContextMenu, Control, DateTimePicker, EditBox, Grid, HTMLElement, HTMLLink, HTMLTable, Image, Item, Label, Link, ListBox, ListView, Menu, NavigationField, PopupMenu, ProgressBar, RadioButton, Row, RowHeader, ScrollBar, Slider, SpinBox, SubItem, Tab, TabBar, ToolBar, Tree, Window
Example
Window("WysiCorp Home").HTMLElement("elementLoginTester").OCRCheckpoint(92, "solobug", 74, -35, 60, 18)