open method

Class: EyesPlatform: Selenium 3Language: Python SDK:

Call this method to start a test, before calling any of the check methods.

Syntax


outdriver = eyes.open(driver, app_name, test_name, viewport_size)

outdriver = eyes.open(driver, app_name, test_name)

outdriver = eyes.open(driver, app_name)

outdriver = eyes.open(driver)

Parameters

driver
Type:AnyWebDriver
The web driver.
AnyWebDriver
The type AnyWebDriver is defined as: Union[EyesWebDriver,WebDriver] This object can be used in the same way as the Selenium driver object.
app_name
Type:Text [Optional : default = None ]
The application name. This may be any string. You can set the application name for all tests using the method(s) Configuration.set_app_name or Eyes.app_name. If you do so, then set this parameter to a value of to indicate that the configuration default should be used.
test_name
Type:Text [Optional : default = None ]
The name of the test. This name must be unique within the scope of the application name. It may be any string.
viewport_size
Type:ViewPort [Optional : default = None ]

The size of the viewport

The size of the viewport passed as an object.

The size of the viewport passed as an object {'width':, 'height':}

Defines the viewport size of the browser that will be set before the start of the test. If this parameter is not provided then the viewport size will be based on the current browser window size. See Using viewports in Eyes for more details.

Passing a value of None specifies that the default viewport size should be used. If Eyes.set_viewport_size is called before the call to this method, then the default is determined by the value set by that method. If it is not called, then the default viewport size is system and application dependent.
ViewPort
The type ViewPort is defined as: Union[Dict[Text,int],<a class ='link' href='/Content/api/eyes-sdk/index-gen/class-rectanglesize-selenium-python_sdk4.htm'>RectangleSize</a>]

Return value

Type: EyesWebDriver
The returned web driver is a clone of the driver passed as a parameter. It is recomended that you use the web driver object returned by this method in all further calls to the web driver. This allows Eyes to record these interactions and play them back in the Eyes Test Manager.

Remarks

After making a call to this method, you must eventually terminate the test by calling Eyes.close_async (in case of a normal completion) or Eyes.abort_async (in case of an aborted test). If you want to run another test, then it is recomended to do this with a newly created Eyes instance to avoid side effects. However, in principle, it is legal to call Eyes.open again to start a new test on the same Eyes instance.