setFeatures method

Class: ConfigurationPlatform: Selenium 3Language: Java SDK:

Use this method to enable various Eyes features.


Configuration configval = config.setFeatures(feature, features);


One or more features to set.
Type:Feature ...
One or more features to set.

Return value

Type: Configuration


The following values may be passed to this method:
If this feature is set, then Eyes uses internal information regarding mobile devices instead of the information provided by Appium.

Some versions of Appium have inaccurate information, such as screen size and pixel scale ratio, on certain mobile devices. If you have issues with capturing correct images on a mobile device, try calling Configuration.setFeatures, passing a value of Feature.USE_PREDEFINED_DEVICE_INFO, for example:

This instructs Eyes to use information stored in Eyes about the mobile devices that have been tested and are known to work correctly.

This option may help in cases where rendering fails because of a clash between the test program's use of the WebDriver to access frames and the SDK's attempt to take a screenshot.

The recommended way to access the Selenium WebDriver is as follows:

originalWebDriver = new ChromeDriver();
WebDriver webDriver =, appName, testName, viewport)

The code creates a WebDriver instance (originalWebDriver) and passes this to the method The method returns a clone of originalWebDriver that the test assigns to the variable webDriver. Thereafter, the program should use webDriver to access Selenium and not originalWebDriver.

This pattern enables Eyes to be aware of changes in the state of the browser, and it can use this information during the screen capture process.

If the test must use the originalWebDriver object and not webDriver, this can cause the screen capture to fail. If this happens, we recommend that you try to eliminate such failures by calling Configuration.setFeatures, passing as a parameter the value Feature.NO_SWITCH_WITHOUT_FRAME_CHAIN.

Note that this problem sometimes occurs when the originalWebDriver is used to change the context to an internal frame in the window for some reason. The recomended way to check a nested frame nested is by calling the SeleniumCheckSettings.frame method, without switching into the frame, as follows: