Skip to main content

CheckSettings class

The methods in this class are used as part of the check Fluent API to configure and execute checkpoints.

To use these methods, first create a target object using a method from the Target class, then call one or more of the methods in this class on the returned object, chaining them one after the other using the . operator.

Import statement​

import com.applitools.eyes.selenium.fluent.CheckSettings;

SeleniumCheckSettings method​

Syntax​

SeleniumCheckSettings seleniumCheckSettings = new SeleniumCheckSettings();
SeleniumCheckSettings seleniumCheckSettings = new SeleniumCheckSettings(region);
SeleniumCheckSettings seleniumCheckSettings = new SeleniumCheckSettings(tag);
SeleniumCheckSettings seleniumCheckSettings = new SeleniumCheckSettings(targetLocator);
SeleniumCheckSettings seleniumCheckSettings = new SeleniumCheckSettings(region, isSendDom);

Parameters​

region

Type: Region

Description needed.

tag

Type: String

Description needed.

targetLocator

Type: TargetPathLocator

Description needed.

isSendDom

Type: boolean

Description needed.

Return value​

Type: SeleniumCheckSettings

accessibility method​

Syntax​

eyes.check(Target.window().accessibility(regionSelector, regionType))
eyes.check(Target.window().accessibility(element, regionType))
eyes.check(Target.window().accessibility(regionType, elementsToIgnore))
eyes.check(Target.window().accessibility(targetPathLocator, regionType))
eyes.check(Target.window().accessibility(regionType, targetPathLocators))
eyes.check(Target.window().accessibility(region, regionType))

Parameters​

region

Type: Region

An object that defines a rectangular area in the window.

regionType

Type: AccessibilityRegionType

The accessibility type of the region.

regionSelector

Type: By

A selector that specified one or more elements. The bounding rectangle of each element, defines an accessibility region to be analyzed.

element

Type: WebElement

An element bounding rectangle that defines an accessibility region to be analyzed.

elementsToIgnore

Type: WebElement[]

A list of elements for which areas should not be tested for accessibility.

Return value​

Type: ICheckSettings

For more information about the Contrast advisor feature see Contrast advisor.

autProxy method​

Syntax​

ICheckSettings value = seleniumCheckSettings.autProxy(autProxy);

Parameters​

autProxy

Type: AutProxySettings

Description needed.

Return value​

Type: ICheckSettings

beforeRenderScreenshotHook method​

Syntax​

eyes.check(Target.window().beforeRenderScreenshotHook(hook))

Parameters​

hook

Type: String

A string with legal JavaScript code.

Return value​

Type: CheckSettings

content method​

This method has been deprecated and replaced with ignoreColors.

densityMetrics method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.densityMetrics(xDpi, yDpi);
SeleniumCheckSettings value = seleniumCheckSettings.densityMetrics(xDpi, yDpi, scaleRatio);

Parameters​

xDpi

Type: int

Description needed.

yDpi

Type: int

Description needed.

scaleRatio

Type: Double

Description needed.

Return value​

Type: SeleniumCheckSettings

dynamic method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.dynamic();
SeleniumCheckSettings value = seleniumCheckSettings.dynamic(region, textTypes);
SeleniumCheckSettings value = seleniumCheckSettings.dynamic(element, textTypes);
SeleniumCheckSettings value = seleniumCheckSettings.dynamic(selector, textTypes);
SeleniumCheckSettings value = seleniumCheckSettings.dynamic(targetPathLocator, textTypes);
SeleniumCheckSettings value = seleniumCheckSettings.dynamic(region, padding, textTypes);
SeleniumCheckSettings value = seleniumCheckSettings.dynamic(element, padding, textTypes);
SeleniumCheckSettings value = seleniumCheckSettings.dynamic(selector, padding, textTypes);
SeleniumCheckSettings value = seleniumCheckSettings.dynamic(targetPathLocator, padding, textTypes);

Parameters​

region

Type: Region

A rectangular area of the page that contains text matching one or more dynamic patterns. The bounding rectangle defines a dynamic region for which Eyes verifies the text format rather than performing a pixel comparison.

textTypes

Type: DynamicTextType ...

Zero or more dynamic patterns that Eyes should look for inside the region. If omitted, Eyes auto-detects the patterns. Available built-in values: DynamicTextType.TextField, DynamicTextType.Number, DynamicTextType.Date, DynamicTextType.Link, DynamicTextType.Email, DynamicTextType.Currency. To reference a custom pattern defined in the Test Manager, pass DynamicTextType.Custom("my-pattern-name").

element

Type: WebElement

A WebElement whose bounding rectangle defines a dynamic region.

selector

Type: By

A By selector that identifies one or more elements. The bounding rectangle of each matched element defines a dynamic region.

targetPathLocator

Type: TargetPathLocator

A TargetPathLocator that identifies one or more elements, including shadow-DOM-aware paths. The bounding rectangle of each matched element defines a dynamic region.

padding

Type: Padding

Increases (positive values) or decreases (negative values) the region dimensions relative to the size of the element or selector used to define the region.

Return value​

Type: SeleniumCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You can call this method in two ways — with parameters and without parameters. The meaning of the method, and the way it can be used, is different in each case.

Called without parameters​

If this method is called without parameters then it sets the default match level for this target to Dynamic. This overrides the hard-coded default and the default match level defined by using setMatchLevel. With the Dynamic match level, Eyes recognizes defined text patterns (such as dates, numbers, emails, or links) and ignores changes in their content as long as the format remains valid.

For a given target you may call only one of the following methods (without parameters) that set a target default match level:

  • matchLevel
  • strict
  • ignoreColors
  • layout
  • exact
  • dynamic
Called with parameters​

When the method is called with one or more parameters that define a region, the Dynamic match level is applied to that region, overriding the defaults set for the target, the value set by setMatchLevel, and the hard-coded default match level. You may add multiple dynamic regions to a single checkpoint by calling this method multiple times in a chain.

For a full description of the Dynamic match level, including the available patterns and how to define custom patterns, see Dynamic Match Level. The Dynamic match level is supported on Web tests only.

enablePatterns method​

Syntax​

ICheckSettings value = seleniumCheckSettings.enablePatterns(enablePatterns);
ICheckSettings value = seleniumCheckSettings.enablePatterns();

Parameters​

enablePatterns

Type: Boolean

Description needed.

Return value​

Type: ICheckSettings

exact method​

Syntax​

eyes.check(Target.window().exact())
eyes.check(Target.window().exact(exact))

Parameters​

This method does not take any parameters.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

This method sets the default match level for this target. This overrides the hard-coded default and the default match level defined by using setMatchLevel.

For a given target you may call only one of the following methods that set a target default match level:

  • matchLevel
  • strict
  • ignoreColors
  • layout
  • exact

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, see How to use Eyes match levels.

floating method​

Syntax​

eyes.check(Target.window().floating(regionSelector, maxUpOffset, maxDownOffset, maxLeftOffset, maxRightOffset))
eyes.check(Target.window().floating(regionSelector, maxUpOffset, maxDownOffset, maxLeftOffset, maxRightOffset, regionId))
eyes.check(Target.window().floating(element, maxUpOffset, maxDownOffset, maxLeftOffset, maxRightOffset))
eyes.check(Target.window().floating(element, maxUpOffset, maxDownOffset, maxLeftOffset, maxRightOffset, regionId))
eyes.check(Target.window().floating(targetPathLocator, maxUpOffset, maxDownOffset, maxLeftOffset, maxRightOffset))
eyes.check(Target.window().floating(targetPathLocator, maxUpOffset, maxDownOffset, maxLeftOffset, maxRightOffset, regionId))
eyes.check(Target.window().floating(maxOffset, regions))
eyes.check(Target.window().floating(region, maxUpOffset, maxDownOffset, maxLeftOffset, maxRightOffset))

Parameters​

maxOffset

Type: int

The maximum amount that the region can shift in any direction and still be considered matching.

regions

Type: Region...

One or more region definitions.

regionId

Type: String

ID of a coded region. It can be used to identify a region with a dynamic size or position so Eyes can identify the region while comparing it to the baseline. This parameter is only needed if the size or position of the region may change and the SDK cannot automatically accurately define the region.

region

Type: Region

An object that defines the region.

maxUpOffset

Type: int

The maximum amount that the region can shift upwards and still be considered matching.

maxDownOffset

Type: int

The maximum amount that the region can shift downwards and still be considered matching.

maxLeftOffset

Type: int

The maximum amount that the region can shift to the left and still be considered matching.

maxRightOffset

Type: int

The maximum amount that the region can shift to the right and still be considered matching.

regionSelector

Type: By

An object that defines a selector for the region.

element

Type: WebElement

An element whose position and bounding rectangle defines the region.

Return value​

Type: ICheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may call this method multiple times in a given chain, each call defines a different floating region. Floating regions may not overlap each other or other types of regions, such as ignore or match level regions.

frame method​

Syntax​

eyes.check(Target.frame(by).frame(by))
eyes.check(Target.frame(by).frame(frameNameOrId))
eyes.check(Target.frame(by).frame(index))
eyes.check(Target.frame(by).frame(frameReference))

Parameters​

by

Type: By

Any legal Selenium By request.

frameNameOrId

Type: String

The name or id of the frame element.

index

Type: int

The index of the frame element as defined by Selenium.

frameReference

Type: WebElement

A Selenium reference to the frame element. This can be anything acceptable to the Selenium switch to frame method.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may only use this method in the chain if the first method in the chain is frame. You may not call it if the first method in the chain is window or region. Call this method multiple times to descend a hierarchy of embedded frames.

fully method​

Syntax​

eyes.check(Target.window().fully())
eyes.check(Target.window().fully(fully))

Parameters​

fully

Type: Boolean

If this parameter has a value of true, then Eyes uses scrolling and stitching to capture the entire page. If it's false, then only the viewport will be captured. If the method is called without a parameter, then the default is true.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

This method overrides the global default or the most recent value set by the Eyes.setForceFullPageScreenshot or Configuration.setForceFullPageScreenshot method.

If stitching is done, then the stitch mode used, StitchMode.CSS or StitchMode.SCROLL is determined by the global default or the value set using, Eyes.setStitchMode or Configuration.setStitchMode. You can use the CheckSettings.scrollRootElement method to specify which element should be scrolled to render all of the content of the page. You may only specify one such element per checkpoint. You may only call this method once in a given target.

getAccessibilityRegions method​

Syntax​

GetRegion[] value = seleniumCheckSettings.getAccessibilityRegions();

Parameters​

This method does not take any parameters.

Return value​

Type: GetRegion[]

getAccessibilityValidation method​

Syntax​

AccessibilitySettings value = seleniumCheckSettings.getAccessibilityValidation();

Parameters​

This method does not take any parameters.

Return value​

Type: AccessibilitySettings

getAutProxy method​

Syntax​

AutProxySettings value = seleniumCheckSettings.getAutProxy();

Parameters​

This method does not take any parameters.

Return value​

Type: AutProxySettings

getContentRegions method​

Syntax​

GetRegion[] value = seleniumCheckSettings.getContentRegions();

Parameters​

This method does not take any parameters.

Return value​

Type: GetRegion[]

getDensityMetrics method​

Syntax​

DensityMetrics value = seleniumCheckSettings.getDensityMetrics();

Parameters​

This method does not take any parameters.

Return value​

Type: DensityMetrics

getDynamicRegions method​

Syntax​

GetRegion[] value = seleniumCheckSettings.getDynamicRegions();

Parameters​

This method does not take any parameters.

Return value​

Type: GetRegion[]

getExact method​

Syntax​

eyes.check(Target.window().getExact())

Parameters​

This method does not take any parameters.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

getFloatingRegions method​

Syntax​

GetRegion[] value = seleniumCheckSettings.getFloatingRegions();

Parameters​

This method does not take any parameters.

Return value​

Type: GetRegion[]

getHideCaret method​

Syntax​

Boolean value = seleniumCheckSettings.getHideCaret();

Parameters​

This method does not take any parameters.

Return value​

Type: Boolean

getHideScrollBars method​

Syntax​

Boolean value = seleniumCheckSettings.getHideScrollBars();

Parameters​

This method does not take any parameters.

Return value​

Type: Boolean

getIgnoreCaret method​

Syntax​

Boolean value = seleniumCheckSettings.getIgnoreCaret();

Parameters​

This method does not take any parameters.

Return value​

Type: Boolean

getIgnoreRegions method​

Syntax​

GetRegion[] value = seleniumCheckSettings.getIgnoreRegions();

Parameters​

This method does not take any parameters.

Return value​

Type: GetRegion[]

getLayoutBreakpoints method​

Syntax​

List<Integer> value = seleniumCheckSettings.getLayoutBreakpoints();

Parameters​

This method does not take any parameters.

Return value​

Type: List<Integer>

getLayoutBreakpointsOptions method​

Syntax​

LayoutBreakpointsOptions value = seleniumCheckSettings.getLayoutBreakpointsOptions();

Parameters​

This method does not take any parameters.

Return value​

Type: LayoutBreakpointsOptions

getLayoutRegions method​

Syntax​

GetRegion[] value = seleniumCheckSettings.getLayoutRegions();

Parameters​

This method does not take any parameters.

Return value​

Type: GetRegion[]

getLazyLoadOptions method​

Syntax​

LazyLoadOptions value = seleniumCheckSettings.getLazyLoadOptions();

Parameters​

This method does not take any parameters.

Return value​

Type: LazyLoadOptions

getName method​

Syntax​

String value = seleniumCheckSettings.getName();

Parameters​

This method does not take any parameters.

Return value​

Type: String

getOcrRegion method​

Syntax​

BaseOcrRegion value = seleniumCheckSettings.getOcrRegion();

Parameters​

This method does not take any parameters.

Return value​

Type: BaseOcrRegion

getOverlap method​

Syntax​

Integer value = seleniumCheckSettings.getOverlap();

Parameters​

This method does not take any parameters.

Return value​

Type: Integer

getPageId method​

Syntax​

String value = seleniumCheckSettings.getPageId();

Parameters​

This method does not take any parameters.

Return value​

Type: String

getScriptHooks method​

Syntax​

Map<String, String> value = seleniumCheckSettings.getScriptHooks();

Parameters​

This method does not take any parameters.

Return value​

Type: Map<String, String>

getStitchMode method​

Syntax​

StitchMode value = seleniumCheckSettings.getStitchMode();

Parameters​

This method does not take any parameters.

Return value​

Type: StitchMode

getStitchOverlap method​

Syntax​

StitchOverlap value = seleniumCheckSettings.getStitchOverlap();

Parameters​

This method does not take any parameters.

Return value​

Type: StitchOverlap

getStrictRegions method​

Syntax​

GetRegion[] value = seleniumCheckSettings.getStrictRegions();

Parameters​

This method does not take any parameters.

Return value​

Type: GetRegion[]

getVariationGroupId method​

Syntax​

String value = seleniumCheckSettings.getVariationGroupId();

Parameters​

This method does not take any parameters.

Return value​

Type: String

getVisualGridOptions method​

Syntax​

List<VisualGridOption> value = seleniumCheckSettings.getVisualGridOptions();

Parameters​

This method does not take any parameters.

Return value​

Type: List<VisualGridOption>

getWaitBeforeCapture method​

Syntax​

Integer value = seleniumCheckSettings.getWaitBeforeCapture();

Parameters​

This method does not take any parameters.

Return value​

Type: Integer

hideCaret method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.hideCaret(hideCaret);

Parameters​

hideCaret

Type: Boolean

Description needed.

Return value​

Type: SeleniumCheckSettings

hideScrollBars method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.hideScrollBars(hideScrollBars);

Parameters​

hideScrollBars

Type: Boolean

Description needed.

Return value​

Type: SeleniumCheckSettings

ignore method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.ignore(regionSelector, regionSelectors);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(regionSelector, regionId, regionSelectors);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(element, elements);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(element, regionId, elements);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(regionSelectors);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(regionSelectors, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(elements);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(elements, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(selector, padding);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(selector, padding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(element, padding);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(element, padding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(selector, leftPadding, topPadding, rightPadding, bottomPadding);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(selector, leftPadding, topPadding, rightPadding, bottomPadding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(element, leftPadding, topPadding, rightPadding, bottomPadding);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(element, leftPadding, topPadding, rightPadding, bottomPadding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(targetPathLocator);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(targetPathLocator, padding);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(targetPathLocator, padding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(targetPathLocator, leftPadding, topPadding, rightPadding, bottomPadding);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(targetPathLocator, leftPadding, topPadding, rightPadding, bottomPadding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(region, regions);
SeleniumCheckSettings value = seleniumCheckSettings.ignore(regions);

Parameters​

region

Type: Region

An object that defines a rectangular area in the window.

regionId

Type: String

ID of a coded region. It can be used to identify a region with a dynamic size or position so Eyes can identify the region while comparing it to the baseline. This parameter is only needed if the size or position of the region may change and the SDK cannot automatically accurately define the region.

regions

Type: Region...

An array of Region objects that defines rectangular areas in the checked image.

regions

Type: Region[]

An array of Region objects that defines rectangular areas in the checked image.

regionSelector

Type: By

An object that defines a selector for the region.

regionSelectors

Type: By...

An array of selector objects that define regions.

element

Type: WebElement

An element whose position and bounding rectangle defines the region.

regionSelectors

Type: By[]

An array of selector objects that define regions.

selector

Type: By

An object that defines a selector for the region.

leftPadding

Type: int

Increase (>0) or decrease (<0) the region to the left.

topPadding

Type: int

Increase (>0) or decrease the (<0) region upwards.

rightPadding

Type: int

Increase (>0) or decrease (<0) the region to the right.

bottomPadding

Type: int

Increase (>0) or decrease the (<0) region downwards.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may call this method multiple times in a given chain.

Ignore regions should not overlap each other or other types of regions such as floating or match level regions.

The padding parameters increase (> 0) or decrease (< 0) the region dimensions relative to the size of the element or selector used to define the region.

ignoreCaret method​

Syntax​

eyes.check(Target.window().ignoreCaret(ignoreCaret))
eyes.check(Target.window().ignoreCaret())

Parameters​

ignoreCaret

Type: boolean

If this parameter has a value of true, then Eyes will detect artifacts caused by a blinking cursor and will not report a mismatch for differences caused by these artifacts. If it has a value of , then Eyes will not try to detect artifacts caused by blinking cursors. If no parameter is passed then the default value is true - so the cursor artifacts will be ignored.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may only call this method once in a given chain. This method overrides the global default setting or the setting chosen explicitly for the current target using Eyes.setIgnoreCaret or Configuration.setIgnoreCaret method.

ignoreColors method​

Syntax​

eyes.check(Target.window().ignoreColors(regionSelector, regionSelectors))
eyes.check(Target.window().ignoreColors(element, elements))
eyes.check(Target.window().ignoreColors(regionSelectors))
eyes.check(Target.window().ignoreColors(elements))
eyes.check(Target.window().ignoreColors(selector, leftPadding, topPadding, rightPadding, bottomPadding))
eyes.check(Target.window().ignoreColors(element, leftPadding, topPadding, rightPadding, bottomPadding))
eyes.check(Target.window().ignoreColors())
eyes.check(Target.window().ignoreColors(region, regions))
eyes.check(Target.window().ignoreColors(regions))

Parameters​

region

Type: Region

An object that defines a rectangular area in the window.

regions

Type: Region...

An array of Region objects that defines rectangular areas in the checked image.

regions

Type: Region[]

An array of Region objects that defines rectangular areas in the checked image.

regionSelector

Type: By

An object that defines a selector for the region.

regionSelectors

Type: By...

One or more region definitions.

element

Type: WebElement

An element whose position and bounding rectangle defines the region.

elements

Type: WebElement...

One or more elements, each of whose bounding rectangle defines a region.

regionSelectors

Type: By[]

An array of selector objects that define regions.

elements

Type: WebElement[]

One or more elements, each of whose bounding rectangle defines a region.

selector

Type: By

An object that defines a selector for the region.

leftPadding

Type: int

Increase (>0) or decrease (<0) the region to the left.

topPadding

Type: int

Increase (>0) or decrease the (<0) region upwards.

rightPadding

Type: int

Increase (>0) or decrease (<0) the region to the right.

bottomPadding

Type: int

Increase (>0) or decrease the (<0) region downwards.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

The padding parameters increase (> 0) or decrease (< 0) the region dimensions relative to the size of the element or selector used to define the region.

You can call this method in two ways - with parameters and without parameters. The meaning of the method, and the way it can be used is different in each case. When the method is called without parameters it sets the default match level for this target. When called with one or more regions as parameters it defines the match level for that region. The sections below provide some more details regarding how to use this method in each of these modes.

Called without parameters​

If this method is called without parameters then it sets the default match level for this target. This overrides the hard-coded default and the default match level defined by using setMatchLevel.

For a given target you may call only one of the following methods (without parameters) that set a target default match level:

  • matchLevel
  • strict
  • ignoreColors
  • layout
  • exact
Called with parameters​

When the method is called with one or more parameters that define one or more regions, then these set the match level for those regions, overiding the defaults set for the target (by calling these methods without a parameter), set by setMatchLevel and the hardcoded default match level.

You may define multiple regions that have an explicit match level by calling this method multiple times in a chain, or by passing the method multiple regions.

The region matchlevel methods strict(regions), layout(regions), ignoreColors(regions), strictRegions(regions), layoutRegions(regions), and contentRegions(regions) should not overlap each other or the regions defined using checksettings.ignore (regions) or ignoreRegions(regions). If they overlap with each other, or regions that were defined using the Test Manager, then the results are undefined.

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.

ignoreColors method​

Syntax​

ICheckSettings value = seleniumCheckSettings.ignoreColors();

Parameters​

This method does not take any parameters.

Return value​

Type: ICheckSettings

ignoreDisplacements method​

Syntax​

eyes.check(Target.window().ignoreDisplacements(ignoreDisplacements))
eyes.check(Target.window().ignoreDisplacements())

Parameters​

ignoreDisplacements

Type: boolean

If a value of true is passed, then mismatches due to displaced content will not be displayed in the Test Manager. Otherwise, they will be displayed.

Return value​

Type: CheckSettings

Remarks​

Ignore displacements is only active when using a Match level of STRICT or IGNORECOLORS.

isDefaultLayoutBreakpointsSet method​

Syntax​

Boolean value = seleniumCheckSettings.isDefaultLayoutBreakpointsSet();

Parameters​

This method does not take any parameters.

Return value​

Type: Boolean

isDisableBrowserFetching method​

Syntax​

Boolean value = seleniumCheckSettings.isDisableBrowserFetching();

Parameters​

This method does not take any parameters.

Return value​

Type: Boolean

isEnablePatterns method​

Syntax​

Boolean value = seleniumCheckSettings.isEnablePatterns();

Parameters​

This method does not take any parameters.

Return value​

Type: Boolean

isIgnoreDisplacements method​

Syntax​

Boolean value = seleniumCheckSettings.isIgnoreDisplacements();

Parameters​

This method does not take any parameters.

Return value​

Type: Boolean

isSendDom method​

Syntax​

Boolean value = seleniumCheckSettings.isSendDom();

Parameters​

This method does not take any parameters.

Return value​

Type: Boolean

isStitchContent method​

Syntax​

Boolean value = seleniumCheckSettings.isStitchContent();

Parameters​

This method does not take any parameters.

Return value​

Type: Boolean

isUseDom method​

Syntax​

Boolean value = seleniumCheckSettings.isUseDom();

Parameters​

This method does not take any parameters.

Return value​

Type: Boolean

layout method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.layout(regionSelector, regionSelectors);
SeleniumCheckSettings value = seleniumCheckSettings.layout(regionSelector, regionId, regionSelectors);
SeleniumCheckSettings value = seleniumCheckSettings.layout(element, elements);
SeleniumCheckSettings value = seleniumCheckSettings.layout(element, regionId, elements);
SeleniumCheckSettings value = seleniumCheckSettings.layout(regionSelectors);
SeleniumCheckSettings value = seleniumCheckSettings.layout(regionSelectors, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.layout(elements);
SeleniumCheckSettings value = seleniumCheckSettings.layout(elements, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.layout(selector, padding);
SeleniumCheckSettings value = seleniumCheckSettings.layout(selector, padding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.layout(element, padding);
SeleniumCheckSettings value = seleniumCheckSettings.layout(element, padding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.layout(selector, leftPadding, topPadding, rightPadding, bottomPadding);
SeleniumCheckSettings value = seleniumCheckSettings.layout(selector, leftPadding, topPadding, rightPadding, bottomPadding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.layout(element, leftPadding, topPadding, rightPadding, bottomPadding);
SeleniumCheckSettings value = seleniumCheckSettings.layout(element, leftPadding, topPadding, rightPadding, bottomPadding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.layout(targetPathLocator);
SeleniumCheckSettings value = seleniumCheckSettings.layout(targetPathLocator, padding);
SeleniumCheckSettings value = seleniumCheckSettings.layout(targetPathLocator, padding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.layout(targetPathLocator, leftPadding, topPadding, rightPadding, bottomPadding);
SeleniumCheckSettings value = seleniumCheckSettings.layout(targetPathLocator, leftPadding, topPadding, rightPadding, bottomPadding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.layout();
SeleniumCheckSettings value = seleniumCheckSettings.layout(region, regions);
SeleniumCheckSettings value = seleniumCheckSettings.layout(regions);

Parameters​

region

Type: Region

An object that defines a rectangular area in the window.

regionId

Type: String

ID of a coded region. It can be used to identify a region with a dynamic size or position so Eyes can identify the region while comparing it to the baseline. This parameter is only needed if the size or position of the region may change and the SDK cannot automatically accurately define the region.

regions

Type: Region...

Zero or more additional rectangle objects separated by commas or passed as an array.

regions

Type: Region[]

An array of Region objects that defines rectangular areas in the checked image.

regionSelector

Type: By

An object that defines a selector for the region.

regionSelectors

Type: By...

one or more selectors separated by commas.

element

Type: WebElement

An element whose position and bounding rectangle defines the region.

elements

Type: WebElement...

One or more elements, each of whose bounding rectangle defines a region.

regionSelectors

Type: By[]

An array of selector objects that define regions.

elements

Type: WebElement[]

One or more elements, each of whose bounding rectangle defines a region.

selector

Type: By

An object that defines a selector for the region.

leftPadding

Type: int

Increase (>0) or decrease (<0) the region to the left.

topPadding

Type: int

Increase (>0) or decrease the (<0) region upwards.

rightPadding

Type: int

Increase (>0) or decrease (<0) the region to the right.

bottomPadding

Type: int

Increase (>0) or decrease the (<0) region downwards.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

The padding parameters increase (> 0) or decrease (< 0) the region dimensions relative to the size of the element or selector used to define the region.

You can call this method in two ways - with parameters and without parameters. The meaning of the method, and the way it can be used is different in each case. When the method is called without parameters it sets the default match level for this target. When called with one or more regions as parameters it defines the match level for that region. The sections below provide some more details regarding how to use this method in each of these modes.

Called without parameters​

If this method is called without parameters then it sets the default match level for this target. This overrides the hard-coded default and the default match level defined by using setMatchLevel.

For a given target you may call only one of the following methods (without parameters) that set a target default match level:

  • matchLevel
  • strict
  • ignoreColors
  • layout
  • exact
Called with parameters​

When the method is called with one or more parameters that define one or more regions, then these set the match level for those regions, overiding the defaults set for the target (by calling these methods without a parameter), set by setMatchLevel and the hardcoded default match level.

You may define multiple regions that have an explicit match level by calling this method multiple times in a chain, or by passing the method multiple regions.

The region matchlevel methods strict(regions), layout(regions), content(regions), strictRegions(regions), layoutRegions(regions), and contentRegions(regions) should not overlap each other or the regions defined using checksettings.ignore (regions) or ignoreRegions(regions). If they overlap with each other, or regions that were defined using the Test Manager, then the results are undefined.

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.

layoutBreakpoints method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.layoutBreakpoints(shouldSet);
SeleniumCheckSettings value = seleniumCheckSettings.layoutBreakpoints(breakpoints);
SeleniumCheckSettings value = seleniumCheckSettings.layoutBreakpoints(breakpoints);
SeleniumCheckSettings value = seleniumCheckSettings.layoutBreakpoints(layoutBreakpointsOptions);

Parameters​

shouldSet

Type: boolean

Pass a value of true to enable this feature.

breakpoints

Type: Integer...

Pass one or more viewport widths explicitly, and the JavaScript is executed and the DOM is extracted for each viewport width. For each target, the Ultrafast Grid uses the DOM extracted with the widest viewport that is smaller than the viewport width.

For example, if the values 640, 768, and 1024 are passed, then targets with a width between 640 and 767 (inclusive) use the DOM extracted at 640. Similarly, targets between 768 and 1023 use the DOM extracted at 768.

Targets that have a width smaller than the smallest defined width use a DOM extracted at one less than the smallest DOM width (639 in this example). Targets that have a width larger than the largest width defined (1024 in this example) use the DOM extracted at the largest width. If no width is specified, then a separate DOM is extracted for each distinct execution environment viewport width.

Type: LayoutBreakpointsOptions

This object enables page reloading at each configured breakpoint.

Return value​

Type: CheckSettings

Remarks​

This method enables and sets breakpoints for the current checkpoint. It overrides the default values when the test is configured with a previous use of Configuration.setLayoutBreakpoints method.

lazyLoad method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.lazyLoad();
SeleniumCheckSettings value = seleniumCheckSettings.lazyLoad(lazyLoadOptions);
// lazy loads with options specified
eyes.check(Target.window().lazyLoad(new LazyLoadOptions()
.maxAmountToScroll(1000) // total pixels of the page to be scrolled
.scrollLength(250) // amount of pixels to use for each scroll attempt
.waitingTime(500) // milliseconds to wait in-between each scroll attempt
));

Scrolls the entire page, or a specific length of the page, to make sure all lazily loaded assets are on the page before performing a check.

Parameters​

maxAmountToScroll

Type: int

Total pixels of the page to be scrolled

scrollLength

Type: int

Number of pixels to use for each scroll attempt

waitingTime

Type: int

The wait time between scroll attempts in milliseconds.

Remarks​

  • If you do not enter an option, the sensible default for that value will be used
  • The SDK will repeatedly scroll the page using the scrollLength until either the page cannot be scrolled further or the maxAmountToScroll has been reached (whichever happens first)

matchLevel method​

Syntax​

eyes.check(Target.window().matchLevel(matchLevel))

Parameters​

matchLevel

Type: MatchLevel

Available match level values are:

  • NONE
  • STRICT
  • LAYOUT
  • IGNORECOLORS
  • DYNAMIC
  • EXACT

For a description of these match levels and the different ways to apply them to tests, checkpoints, and regions, see Eyes match levels. For the DYNAMIC match level specifically, see Dynamic Match Level.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

The value provided here overrides the default match level, or the global value set for this target using Eyes.setMatchLevel or Configuration.setMatchLevel. You may only call this method once in a given chain. If you call this method, then you can't call the other match level methods.

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.

ocrRegion method​

Syntax​

ICheckSettings value = seleniumCheckSettings.ocrRegion(ocrRegion);

Parameters​

ocrRegion

Type: BaseOcrRegion

Description needed.

Return value​

Type: ICheckSettings

pageId method​

Syntax​

ICheckSettings value = seleniumCheckSettings.pageId(pageId);

Parameters​

pageId

Type: String

Description needed.

Return value​

Type: ICheckSettings

region method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.region(region);
SeleniumCheckSettings value = seleniumCheckSettings.region(element);
SeleniumCheckSettings value = seleniumCheckSettings.region(by);
SeleniumCheckSettings value = seleniumCheckSettings.region(targetPathLocator);

Parameters​

region

Type: Region

An object that defines the region.

element

Type: WebElement

An object which defines a region.

by

Type: By

Any legal Selenium By request.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

The parameter to the method specifies the region to be matched. The enclosing frame(s) are selected by the previous calls in the chain to Target.frame. You may only use this method in the chain if the first method in the chain is Target.frame. You may not call it if the first method in the chain is Target.window or Target.region. To match a region within a window, use the method Target.region as the first method in the Target chain. You may only call this method once in a given chain.

scriptHook method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.scriptHook(hook);

Note: This method has been deprecated.

Parameters​

hook

Type: String

Description needed.

Return value​

Type: SeleniumCheckSettings

scrollRootElement method​

Syntax​

eyes.check(Target.window().scrollRootElement(selector))
eyes.check(Target.window().scrollRootElement(element))

Parameters​

selector

Type: By

A By selector to the element that should be scrolled.

element

Type: WebElement

The element that should be scrolled.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

sendDom method​

Syntax​

eyes.check(Target.window().sendDom(sendDom))
eyes.check(Target.window().sendDom())

Parameters​

sendDom

Type: boolean

If a value of true is passed then send DOM information for this checkpoint even if sending DOM is disabled globally.

Return value​

Type: ICheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

setAccessibilityValidation method​

Syntax​

ICheckSettings value = seleniumCheckSettings.setAccessibilityValidation(accessibilitySettings);

Parameters​

accessibilitySettings

Type: AccessibilitySettings

Description needed.

Return value​

Type: ICheckSettings

setDisableBrowserFetching method​

Syntax​

ICheckSettings value = seleniumCheckSettings.setDisableBrowserFetching(disableBrowserFetching);

Parameters​

disableBrowserFetching

Type: Boolean

If true, the SDK will fetch the resources needed for UFG rendering from outside of the browser (useful for sites with large payloads).

Return value​

Type: ICheckSettings

setHideCaret method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.setHideCaret(hideCaret);

Note: This method has been deprecated.

Parameters​

hideCaret

Type: Boolean

Description needed.

Return value​

Type: SeleniumCheckSettings

setHideScrollBars method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.setHideScrollBars(hideScrollBars);

Note: This method has been deprecated.

Parameters​

hideScrollBars

Type: Boolean

Description needed.

Return value​

Type: SeleniumCheckSettings

setLayoutBreakpoints method​

Syntax​

ICheckSettings value = seleniumCheckSettings.setLayoutBreakpoints(shouldSet);
ICheckSettings value = seleniumCheckSettings.setLayoutBreakpoints(breakpoints);
ICheckSettings value = seleniumCheckSettings.setLayoutBreakpoints(breakpoints);

Note: This method has been deprecated.

Parameters​

shouldSet

Type: Boolean

Description needed.

breakpoints

Type: Integer...

Description needed.

Return value​

Type: ICheckSettings

setOverlap method​

Syntax​

ICheckSettings value = seleniumCheckSettings.setOverlap(overlap);

Parameters​

overlap

Type: Integer

Description needed.

Return value​

Type: ICheckSettings

setStitchContent method​

Syntax​

seleniumCheckSettings.setStitchContent(stitchContent);

Parameters​

stitchContent

Type: boolean

Description needed.

Return value​

Type: void

stitchMode method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.stitchMode(stitchMode);

Parameters​

stitchMode

Type: StitchMode

Description needed.

Return value​

Type: SeleniumCheckSettings

stitchOverlap method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.stitchOverlap(overlap);
SeleniumCheckSettings value = seleniumCheckSettings.stitchOverlap(stitchOverlap);

Parameters​

overlap

Type: Integer

Description needed.

stitchOverlap

Type: StitchOverlap

Description needed.

Return value​

Type: SeleniumCheckSettings

strict method​

Syntax​

SeleniumCheckSettings value = seleniumCheckSettings.strict(regionSelector, regionSelectors);
SeleniumCheckSettings value = seleniumCheckSettings.strict(regionSelector, regionId, regionSelectors);
SeleniumCheckSettings value = seleniumCheckSettings.strict(element, elements);
SeleniumCheckSettings value = seleniumCheckSettings.strict(element, regionId, elements);
SeleniumCheckSettings value = seleniumCheckSettings.strict(regionSelectors);
SeleniumCheckSettings value = seleniumCheckSettings.strict(regionSelectors, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.strict(elements);
SeleniumCheckSettings value = seleniumCheckSettings.strict(elements, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.strict(selector, padding);
SeleniumCheckSettings value = seleniumCheckSettings.strict(selector, padding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.strict(element, padding);
SeleniumCheckSettings value = seleniumCheckSettings.strict(element, padding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.strict(selector, leftPadding, topPadding, rightPadding, bottomPadding);
SeleniumCheckSettings value = seleniumCheckSettings.strict(selector, leftPadding, topPadding, rightPadding, bottomPadding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.strict(element, leftPadding, topPadding, rightPadding, bottomPadding);
SeleniumCheckSettings value = seleniumCheckSettings.strict(element, leftPadding, topPadding, rightPadding, bottomPadding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.strict(targetPathLocator);
SeleniumCheckSettings value = seleniumCheckSettings.strict(targetPathLocator, padding);
SeleniumCheckSettings value = seleniumCheckSettings.strict(targetPathLocator, padding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.strict(targetPathLocator, leftPadding, topPadding, rightPadding, bottomPadding);
SeleniumCheckSettings value = seleniumCheckSettings.strict(targetPathLocator, leftPadding, topPadding, rightPadding, bottomPadding, regionId);
SeleniumCheckSettings value = seleniumCheckSettings.strict();
SeleniumCheckSettings value = seleniumCheckSettings.strict(region, regions);
SeleniumCheckSettings value = seleniumCheckSettings.strict(regions);

Parameters​

region

Type: Region

An object that defines a rectangular area in the window.

regionId

Type: String

ID of a coded region. It can be used to identify a region with a dynamic size or position so Eyes can identify the region while comparing it to the baseline. This parameter is only needed if the size or position of the region may change and the SDK cannot automatically accurately define the region.

regions

Type: Region...

An array of Region objects that defines rectangular areas in the checked image.

regions

Type: Region[]

An array of Region objects that defines rectangular areas in the checked image.

regionSelector

Type: By

An object that defines a selector for the region.

regionSelectors

Type: By...

One or more region definitions.

element

Type: WebElement

An element whose position and bounding rectangle defines the region.

elements

Type: WebElement...

One or more elements, each of whose bounding rectangle defines a region.

regionSelectors

Type: By[]

An array of selector objects that define regions.

elements

Type: WebElement[]

One or more elements, each of whose bounding rectangle defines a region.

selector

Type: By

An object that defines a selector for the region.

leftPadding

Type: int

Increase (>0) or decrease (<0) the region to the left.

topPadding

Type: int

Increase (>0) or decrease the (<0) region upwards.

rightPadding

Type: int

Increase (>0) or decrease (<0) the region to the right.

bottomPadding

Type: int

Increase (>0) or decrease the (<0) region downwards.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

The padding parameters increase (> 0) or decrease (< 0) the region dimensions relative to the size of the element or selector used to define the region.

You can call this method in two ways - with parameters and without parameters. The meaning of the method, and the way it can be used is different in each case. When the method is called without parameters it sets the default match level for this target. When called with one or more regions as parameters it defines the match level for that region. The sections below provide some more details regarding how to use this method in each of these modes.

Called without parameters​

If this method is called without parameters then it sets the default match level for this target. This overrides the hard-coded default and the default match level defined by using setMatchLevel.

For a given target you may call only one of the following methods (without parameters) that set a target default match level:

  • matchLevel
  • strict
  • ignoreColors
  • layout
  • exact
Called with parameters​

When the method is called with one or more parameters that define one or more regions, then these set the match level for those regions, overiding the defaults set for the target (by calling these methods without a parameter), set by setMatchLevel and the hardcoded default match level.

You may define multiple regions that have an explicit match level by calling this method multiple times in a chain, or by passing the method multiple regions.

The region matchlevel methods strict(regions), layout(regions), content(regions), strictRegions(regions), layoutRegions(regions), and contentRegions(regions) should not overlap each other or the regions defined using checksettings.ignore (regions) or ignoreRegions(regions). If they overlap with each other, or regions that were defined using the Test Manager, then the results are undefined.

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.

timeout method​

Syntax​

eyes.check(Target.window().timeout(timeoutMilliseconds))

Parameters​

timeoutMilliseconds

Type: int

The timeout to use in milliseconds.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may only call this method once in a given chain. The timeout value provided here overrides the default value or the value set by setMatchTimeout for the current target. Passing this method a value of zero disables the timeout mechanism.

useDom method​

Syntax​

ICheckSettings value = seleniumCheckSettings.useDom(useDom);

Parameters​

useDom

Type: Boolean

Description needed.

Return value​

Type: ICheckSettings

variationGroupId method​

Syntax​

eyes.check(Target.window().variationGroupId(variationGroupId))

Parameters​

variationGroupId

Type: String

The value of the variation group ID to be set.

Return value​

Type: ICheckSettings

visualGridOptions method​

Syntax​

eyes.check(Target.window().visualGridOptions(options))

Parameters​

options

Type: VisualGridOption...

One or more options for configuring the Ultrafast Grid.

Return value​

Type: ICheckSettings

Remarks​

The following configuration key/value pairs are currently supported:

chromeHeadless

Normally, the Ultrafast Grid renders its images using Headless Chrome. There are cases where the behavior of Headless Chrome is different from that of regular Chrome browser, and if the baseline was created with a regular Chrome browser, the differences will be found. Set this option to a value of false to instruct the Ultrafast Grid to use a regular Chrome browser instead of the Headless Chrome browser.

polyfillAdoptedStyleSheets

Adopted Stylesheets are a way to create and distribute reusable styles when using a Shadow DOM. Adopted Stylesheets are not supported by all browsers, so their use may cause mismatches when doing cross-browser validation. By default, when the Ultrafast Grid detects that a page being checked uses Adopted Stylesheets, it will not render that checkpoint, the check will fail, and the test will be aborted. In the Test Manager, the test results for that run will have an Aborted status, and the step that failed will have a Missing status.

To enable rendering of checkpoints that include Adopted Stylesheets, and to ensure that the test can complete successfully, you need to explicitly set the Ultrafast Grid option polyfillAdoptedStyleSheets to a value of true or false:

  • true instructs the Ultrafast Grid to polyfill Adopted Stylesheets.
  • false instructs the Ultrafast Grid to render the page without polyfilling Adopted Stylesheets.

You can set this option globally using the method Configuration.setVisualGridOptions

You can override the global value for a given checkpoint using the method CheckSettings.visualGridOptions

Example​

Java
eyes.check(
Target.window()
.visualGridOptions(new VisualGridOption("polyfillAdoptedStyleSheets", true)));

waitBeforeCapture method​

Syntax​

ICheckSettings value = seleniumCheckSettings.waitBeforeCapture(milliSec);

Parameters​

milliSec

Type: Integer

Description needed.

Return value​

Type: ICheckSettings

withName method​

Syntax​

eyes.check(Target.window().withName(name))

Parameters​

name

Type: String

The name to be given to this check point.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may only call this method once in a given chain.