Skip to main content

VisualGridRunner class

An object of this class is used to manage multiple Eyes sessions when working with the Ultrafast Grid.

To work without the Ultrafast Grid, use ClassicRunner instead of this class.

Import statement

from applitools.selenium import VisualGridRunner

VisualGridRunner method

Syntax

runner = VisualGridRunner(options_or_concurrency)

Parameters

options_or_concurrency

Type: Union[RunnerOptions,int] [Optional : default = RunnerOptions() ]

Pass the concurrency to be used using a RunnerOptions constructor and test_concurrency methods as shown in the example below. Passing the concurrency as an integer will eventually be deprecated and should not be used.

Return value

Type: None

Example

The example below demonstrates the creation of a VisualGridRunner instance. It is initialized with a call to the constructor RunnerOptions. A call to test_concurrency is then appended with a parameter of 10. This runner instance is passed to the Eyes instance when it is created. The end effect is that the runner manages the workflow and concurrency of all Eyes instances that are initialized with that runner. Passing a parameter of 10 means that the runner limits the concurrency to a maximum of 10 active test executions.

Python

runner = VisualGridRunner(RunnerOptions().test_concurrency(concurrent_sessions))   
eyes = Eyes(runner)

get_all_test_results method

Syntax

runner = runner.get_all_test_results(should_raise_exception)

runner = runner.get_all_test_results()

Parameters

should_raise_exception

Type: bool [Optional : default = True ]

If a value of True is passed and any test did not pass, or there was a failure, then an exception is thrown. If a value of False is passed, then the object returned contains the test results and status of all the tests. The calling program should use the TestResultContainer.exception property to examine the exception status and, if it is null, check the various methods in the TestResults returned by the method test_results to see if the tests passed or mismatched where found. If no parameter is passed, then the default value is True.

Return value

Type: TestResultsSummary