TextRegionSettings class

Platform: Selenium 3Language: Java SDK:
An object of this type is used to pass options to Eyes.extractTextRegions.
Typically, you call the class constructor and then call the methods of this class chained in a Fluent API style to set the required options.

For more information see Eyes OCR support .

This feature is experimental. Please note that the functionality and/or API may change.

Import statement

import com.applitools.eyes.locators.TextRegionSettings;
	

Example

String[] patternList = {};
Map<String, List<TextRegion>> resultRegions = eyes.extractTextRegions(
        new TextRegionSettings(
                ".+",
                "applitools",
                "Click here",
                "\\d+-\\d+-\\d+",
                "\\S+: \\d+"));
for (Map.Entry<String, List<TextRegion>> entry : resultRegions.entrySet()) {
    System.out.printf("for pattern %s found:\n", entry.getKey());
    for (TextRegion info : entry.getValue()) {
        System.out.printf("x: %d, y:%d, width:%d. heigth:%d, text '%s'\n",
                info.getX(), info.getY(), info.getWidth(), info.getHeight(), info.getText());
    }

Constructor

TextRegionSettings()
Define a list of string literals or patterns to be searched for using OCR using the Eyes.extractTextRegions method.
TextRegionSettings()
Define a list of string literals or patterns to be searched for using OCR using the Eyes.extractTextRegions method.

Methods

firstOnly()
Use this method to define that only the first text found should be returned.
firstOnly()
Use this method to define that only the first text found should be returned.
ignoreCase()
Define that the pattern should be case insensitive.
ignoreCase()
Define that the pattern should be case insensitive.