setVisualGridOptions method

Class: ConfigurationPlatform: Selenium 3Language: Java SDK:

Use this method to set configuration values for the Ultrafast Grid.

Syntax


Configuration configval = config.setVisualGridOptions(option, options);

Parameters

option
Type:VisualGridOption
The first configuration option for the Ultrafast Grid.
options
Type:VisualGridOption ...
Optional additional configuration options for the Ultrafast Grid.

Return value

Type: Configuration

Remarks

The following configuration values are currently supported:

"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:

  • Setting a value of true instructs the Ultrafast Grid to polyfill Adopted Stylesheets.
  • Setting a value of 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 SeleniumCheckSettings.visualGridOptions.

Example

/* test suite setup */  
    suiteConfig = new Configuration() 
            .setVisualGridOptions(new VisualGridOption("polyfillAdoptedStyleSheets", true))   
/* ... other configurations */  ; 
    /*
     * Assign the configuration to all newly created Eyes instances
     */
    eyes = new Eyes(runner);
    eyes.setConfiguration(suiteConfig);