Assistive-Webdriver

Home > assistive-playwright-client > CalibrationResult

CalibrationResult class

Result of the calibration, returned by playwrightCalibrate(), and allowing to translate coordinates relative to the top-left corner of the viewport, or coordinates relative to the center of a DOM element into screen coordinates.

Signature:

export declare class CalibrationResult implements ScreenPosition 

Implements: ScreenPosition

Constructors

Constructor Modifiers Description
(constructor)(x, y, screenWidth, screenHeight, vm, frame)   Creates an instance of CalibrationError, containing the coordinates of the viewport inside the browser window. An object of this class is returned by playwrightCalibrate() if the calibration succeeds.

Properties

Property Modifiers Type Description
frame   Page | Frame Reference to the playwright frame object.
screenHeight   number Height of the screen in pixels.
screenWidth   number Width of the screen in pixels.
vm   VM Reference to the virtual machine.
x   number Horizontal coordinate of the viewport inside the browser window.
y   number Vertical coordinate of the viewport inside the browser window.

Methods

Method Modifiers Description
translateCoordinates(position, origin)   Translates viewport coordinates or coordinates relative to the center of a DOM element into screen coordinates.