Text Properties
Searching for or reading text on your system under test (SUT) using optical character recognition (OCR) requires use of a text property list. These property lists have a wide variety of properties you can include, depending on the text you are working with and the purpose of your search.
See Working with OCR to learn how to work with the most commonly used text properties in more detail.
This page covers the available OCR properties as they can be addressed in-line with SenseTalk scripting. You can also adjust your OCR properties from several locations in Eggplant Functional (EPF):
What is a Text Property List?
A text property list is a description of text on the SUT. Every text property list must contain the Text
property, which defines the actual text string you are looking for, and any number of the additional properties described below. Any property that is not included in the property list defaults to your Text Preferences settings.
The following text properties can be used with any text property list:
- Text:
Text string
. The text string that you want to find on the SUT. (Required.) - TextStyle:
Text-style name
. A group of predefined text properties. (For more information, see The Find Text Panel.)
OCR Text Properties Reference Table
Use the table below as a reference when working with OCR. It is a complete list of all supported SenseTalk properties for use with OCR. Some properties are available for reading and searching, while some are specific to one or the other. The type of value passed to the property is also included. Click the name of the property for its full description (a full description list is included on this page below the table). For more in-depth information on how to use the most common OCR properties, see Succeeding with OCR.
A boolean
value is like a toggle switch with two possible values; Yes/No values are accepted as well as On/Off.
Property | Searching | Reading | Value |
---|---|---|---|
AggressiveTextExtraction | Yes | Yes | Boolean |
CaseSensitive | Yes | No | Boolean |
Contrast | Yes | Yes | Boolean |
ContrastColor | Yes | Yes | A color (see Color Values in SenseTalk) |
ContrastTolerance | Yes | Yes | 0-100 / Default 45 |
DPI | Yes | Yes | Integer |
EnhanceLocalContrast | Yes | Yes | Boolean |
ExtraWords | Yes | Yes | A string or list of words |
IgnoreNewLines | Yes | No | Boolean |
IgnoreSpaces | Yes | No | Boolean |
IgnoreUnderscores | Yes | No | Boolean |
InvertImage | Yes | Yes | Boolean |
Language | Yes | Yes | A language name as specified in OCR Language Support (case sensitive). |
LowResolutionMode | Yes | Yes | Boolean |
Multiline | No | Yes | Boolean |
PreferDictionaryWords | Yes | Yes | Boolean |
PreferredPattern | Yes | Yes | Regular expression string (see Using Patterns in SenseTalk) |
PreferredWords | Yes | Yes | A string or list of words |
ProhibitedWords | Yes | Yes | A string or list of words |
SearchRectangle | Yes | No* | A pair of coordinates or captured images defining a rectangle |
TextDifference | Yes | No | Integer |
TextRotation | Yes | Yes | One of four predefined values |
Trim | No | Yes | Boolean |
TrimBorder | No | Yes | Integer |
TrimColor | No | Yes | A color (see Color Values in SenseTalk) |
TrimTolerance | No | Yes | Integer |
TrimWhitespace | No | Yes | Boolean |
ValidCharacters | No | Yes | Boolean |
ValidPattern | Yes | Yes | Regular expression string (see Using Patterns in SenseTalk) |
ValidWords | Yes | Yes | A string or list of words |
* You do not need to set a SearchRectangle
property with ReadText
because ReadText
already takes a rectangle by default. This property can also be set with standard image searches; for more on this, see Image References.