selenium.webdriver.common.bidi.input

Classes

ElementOrigin(element_reference)

Represents an element origin for input actions.

FileDialogInfo(context, multiple[, element])

Represents file dialog information from input.fileDialogOpened event.

FileDialogOpened()

Event class for input.fileDialogOpened event.

Input(conn)

BiDi implementation of the input module.

KeyDownAction([value])

Represents a key down action.

KeySourceActions(id, actions)

Represents a sequence of key actions.

KeyUpAction([value])

Represents a key up action.

NoneSourceActions(id, actions)

Represents a sequence of none actions.

Origin()

Represents the possible origin types.

PauseAction([duration])

Represents a pause action.

PointerCommonProperties([width, height, ...])

Common properties for pointer actions.

PointerDownAction([button, properties])

Represents a pointer down action.

PointerMoveAction([x, y, duration, origin, ...])

Represents a pointer move action.

PointerParameters([pointer_type])

Represents pointer parameters for pointer actions.

PointerSourceActions(id, parameters, actions)

Represents a sequence of pointer actions.

PointerType()

Represents the possible pointer types.

PointerUpAction([button])

Represents a pointer up action.

WheelScrollAction([x, y, delta_x, delta_y, ...])

Represents a wheel scroll action.

WheelSourceActions(id, actions)

Represents a sequence of wheel actions.

class selenium.webdriver.common.bidi.input.PointerType[source]

Represents the possible pointer types.

MOUSE = 'mouse'
PEN = 'pen'
TOUCH = 'touch'
VALID_TYPES = {'mouse', 'pen', 'touch'}
class selenium.webdriver.common.bidi.input.Origin[source]

Represents the possible origin types.

VIEWPORT = 'viewport'
POINTER = 'pointer'
class selenium.webdriver.common.bidi.input.ElementOrigin(element_reference: dict)[source]

Represents an element origin for input actions.

type: str
element: dict
to_dict() dict[source]

Convert the ElementOrigin to a dictionary.

class selenium.webdriver.common.bidi.input.PointerParameters(pointer_type: str = 'mouse')[source]

Represents pointer parameters for pointer actions.

pointer_type: str = 'mouse'
to_dict() dict[source]

Convert the PointerParameters to a dictionary.

class selenium.webdriver.common.bidi.input.PointerCommonProperties(width: int = 1, height: int = 1, pressure: float = 0.0, tangential_pressure: float = 0.0, twist: int = 0, altitude_angle: float = 0.0, azimuth_angle: float = 0.0)[source]

Common properties for pointer actions.

width: int = 1
height: int = 1
pressure: float = 0.0
tangential_pressure: float = 0.0
twist: int = 0
altitude_angle: float = 0.0
azimuth_angle: float = 0.0
to_dict() dict[source]

Convert the PointerCommonProperties to a dictionary.

class selenium.webdriver.common.bidi.input.PauseAction(duration: int | None = None)[source]

Represents a pause action.

duration: int | None = None
property type: str
to_dict() dict[source]

Convert the PauseAction to a dictionary.

class selenium.webdriver.common.bidi.input.KeyDownAction(value: str = '')[source]

Represents a key down action.

value: str = ''
property type: str
to_dict() dict[source]

Convert the KeyDownAction to a dictionary.

class selenium.webdriver.common.bidi.input.KeyUpAction(value: str = '')[source]

Represents a key up action.

value: str = ''
property type: str
to_dict() dict[source]

Convert the KeyUpAction to a dictionary.

class selenium.webdriver.common.bidi.input.PointerDownAction(button: int = 0, properties: PointerCommonProperties | None = None)[source]

Represents a pointer down action.

button: int = 0
properties: PointerCommonProperties | None = None
property type: str
to_dict() dict[source]

Convert the PointerDownAction to a dictionary.

class selenium.webdriver.common.bidi.input.PointerUpAction(button: int = 0)[source]

Represents a pointer up action.

button: int = 0
property type: str
to_dict() dict[source]

Convert the PointerUpAction to a dictionary.

class selenium.webdriver.common.bidi.input.PointerMoveAction(x: float = 0, y: float = 0, duration: int | None = None, origin: str | ElementOrigin | None = None, properties: PointerCommonProperties | None = None)[source]

Represents a pointer move action.

x: float = 0
y: float = 0
duration: int | None = None
origin: str | ElementOrigin | None = None
properties: PointerCommonProperties | None = None
property type: str
to_dict() dict[source]

Convert the PointerMoveAction to a dictionary.

class selenium.webdriver.common.bidi.input.WheelScrollAction(x: int = 0, y: int = 0, delta_x: int = 0, delta_y: int = 0, duration: int | None = None, origin: str | ElementOrigin | None = 'viewport')[source]

Represents a wheel scroll action.

x: int = 0
y: int = 0
delta_x: int = 0
delta_y: int = 0
duration: int | None = None
origin: str | ElementOrigin | None = 'viewport'
property type: str
to_dict() dict[source]

Convert the WheelScrollAction to a dictionary.

class selenium.webdriver.common.bidi.input.NoneSourceActions(id: str = '', actions: list[~selenium.webdriver.common.bidi.input.PauseAction] = <factory>)[source]

Represents a sequence of none actions.

id: str = ''
actions: list[PauseAction]
property type: str
to_dict() dict[source]

Convert the NoneSourceActions to a dictionary.

class selenium.webdriver.common.bidi.input.KeySourceActions(id: str = '', actions: list[~selenium.webdriver.common.bidi.input.PauseAction | ~selenium.webdriver.common.bidi.input.KeyDownAction | ~selenium.webdriver.common.bidi.input.KeyUpAction] = <factory>)[source]

Represents a sequence of key actions.

id: str = ''
actions: list[PauseAction | KeyDownAction | KeyUpAction]
property type: str
to_dict() dict[source]

Convert the KeySourceActions to a dictionary.

class selenium.webdriver.common.bidi.input.PointerSourceActions(id: str = '', parameters: ~selenium.webdriver.common.bidi.input.PointerParameters | None = None, actions: list[~selenium.webdriver.common.bidi.input.PauseAction | ~selenium.webdriver.common.bidi.input.PointerDownAction | ~selenium.webdriver.common.bidi.input.PointerUpAction | ~selenium.webdriver.common.bidi.input.PointerMoveAction] = <factory>)[source]

Represents a sequence of pointer actions.

id: str = ''
parameters: PointerParameters | None = None
actions: list[PauseAction | PointerDownAction | PointerUpAction | PointerMoveAction]
property type: str
to_dict() dict[source]

Convert the PointerSourceActions to a dictionary.

class selenium.webdriver.common.bidi.input.WheelSourceActions(id: str = '', actions: list[~selenium.webdriver.common.bidi.input.PauseAction | ~selenium.webdriver.common.bidi.input.WheelScrollAction] = <factory>)[source]

Represents a sequence of wheel actions.

id: str = ''
actions: list[PauseAction | WheelScrollAction]
property type: str
to_dict() dict[source]

Convert the WheelSourceActions to a dictionary.

class selenium.webdriver.common.bidi.input.FileDialogInfo(context: str, multiple: bool, element: dict | None = None)[source]

Represents file dialog information from input.fileDialogOpened event.

context: str
multiple: bool
element: dict | None = None
classmethod from_dict(data: dict) FileDialogInfo[source]

Creates a FileDialogInfo instance from a dictionary.

Parameters:

data: A dictionary containing the file dialog information.

Returns:

FileDialogInfo: A new instance of FileDialogInfo.

class selenium.webdriver.common.bidi.input.FileDialogOpened[source]

Event class for input.fileDialogOpened event.

event_class = 'input.fileDialogOpened'
classmethod from_json(json)[source]

Create FileDialogInfo from JSON data.

class selenium.webdriver.common.bidi.input.Input(conn)[source]

BiDi implementation of the input module.

perform_actions(context: str, actions: list[NoneSourceActions | KeySourceActions | PointerSourceActions | WheelSourceActions]) None[source]

Performs a sequence of user input actions.

Parameters:

context: The browsing context ID where actions should be performed. actions: A list of source actions to perform.

release_actions(context: str) None[source]

Releases all input state for the given context.

Parameters:

context: The browsing context ID to release actions for.

set_files(context: str, element: dict, files: list[str]) None[source]

Sets files for a file input element.

Parameters:

context: The browsing context ID. element: The element reference (script.SharedReference). files: A list of file paths to set.

add_file_dialog_handler(handler)[source]

Add a handler for file dialog opened events.

Parameters:

handler: Callback function that takes a FileDialogInfo object.

Returns:

int: Callback ID for removing the handler later.

remove_file_dialog_handler(callback_id: int) None[source]

Remove a file dialog handler.

Parameters:

callback_id: The callback ID returned by add_file_dialog_handler.