DriverWrapperSessions Interface¶
Note
This is auto-generated interface documentation for the actual signature of DriverWrapperSessions class.
DriverWrapperSessions manages all active DriverWrapper instances, providing centralized session tracking and management.
It ensures efficient handling of multiple driver instances by maintaining a registry of active sessions and facilitating
their retrieval or removal.
This centralization aids in resource management and simplifies the coordination of test execution across various drivers.
- class mops.base.driver_wrapper.DriverWrapperSessions[source]¶
- all_sessions: ClassVar[list[mops.base.driver_wrapper.DriverWrapper]] = []¶
- classmethod add_session(driver_wrapper: DriverWrapper) None[source]¶
Add a
DriverWrapperobject to the session pool.- Parameters:
driver_wrapper – The
DriverWrapperinstance to add to the pool.- Returns:
None
- classmethod remove_session(driver_wrapper: DriverWrapper) None[source]¶
Remove a
DriverWrapperobject from the session pool.- Parameters:
driver_wrapper – The
DriverWrapperinstance to remove from the pool.- Returns:
None
- classmethod sessions_count() int[source]¶
Get the count of initialized
DriverWrapperobjects.- Returns:
int- The number of initialized sessions.
- classmethod first_session() DriverWrapper | None[source]¶
Get the first
DriverWrapperobject from the session pool.- Returns:
The first
DriverWrapperobject in the pool, or None if no session exists.- Return type:
Union[DriverWrapper, None]
- classmethod is_connected() bool[source]¶
Check the connection status of any
DriverWrapperobject in the pool.- Returns:
bool-Trueif at least oneDriverWrapperobject is available, otherwiseFalse.