selenium.webdriver.common.bidi.session

Classes

Session(conn)

UserPromptHandler([alert, before_unload, ...])

Represents the configuration of the user prompt handler.

UserPromptHandlerType()

Represents the behavior of the user prompt handler.

class selenium.webdriver.common.bidi.session.UserPromptHandlerType[source]

Represents the behavior of the user prompt handler.

ACCEPT = 'accept'
DISMISS = 'dismiss'
IGNORE = 'ignore'
VALID_TYPES = {'accept', 'dismiss', 'ignore'}
class selenium.webdriver.common.bidi.session.UserPromptHandler(alert: str | None = None, before_unload: str | None = None, confirm: str | None = None, default: str | None = None, file: str | None = None, prompt: str | None = None)[source]

Represents the configuration of the user prompt handler.

Initialize UserPromptHandler.

Parameters:

alert: Handler type for alert prompts before_unload: Handler type for beforeUnload prompts confirm: Handler type for confirm prompts default: Default handler type for all prompts file: Handler type for file picker prompts prompt: Handler type for prompt dialogs

Raises:

ValueError: If any handler type is not valid

to_dict() dict[str, str][source]

Convert the UserPromptHandler to a dictionary for BiDi protocol.

Returns:

Dict[str, str]: Dictionary representation suitable for BiDi protocol

class selenium.webdriver.common.bidi.session.Session(conn)[source]
subscribe(*events, browsing_contexts=None)[source]
unsubscribe(*events, browsing_contexts=None)[source]
status()[source]

The session.status command returns information about the remote end’s readiness to create new sessions and may include implementation-specific metadata.

Returns

dict

Dictionary containing the ready state (bool), message (str) and metadata