App Management¶
The AppManagement class provides functionality for launching, terminating, and managing application sessions.
optics_framework.api.app_management.AppManagement ¶
A high-level API for managing applications.
This class provides functionality for launching, terminating, and modifying app settings.
Attributes:
| Name | Type | Description |
|---|---|---|
driver | object | The driver instance for managing applications. |
close_and_terminate_app() ¶
Tears down the active driver session and flushes all pending events.
Behaviour depends on the configured driver: WebDriver-based drivers (Appium, Selenium) call quit(); Playwright closes the page, context, and browser; BLE closes the serial port. All variants flush pending EventSDK events and release the driver reference.
force_terminate_app(app_name, event_name=None) ¶
Forcefully terminates the specified application.
:param app_name: The name of the application to terminate. :param event_name: The event triggering the forced termination, if any.
get_app_version(app_package=None) ¶
Gets the version of the application.
:return: The version of the application, or None if not available.
get_driver_session_id() ¶
Return the current driver session id, if available.
initialise_setup() ¶
Sets up the environment for the driver module.
This method should be called before performing any application management operations.
Not exposed on the Optics SDK because it currently performs no operation and doesn't delegate to the driver's own initialise_setup (e.g. AppiumDriver.initialise_setup).
launch_app(app_identifier=None, app_activity=None, event_name=None) ¶
Launches the specified application.
:param event_name: The event triggering the app launch, if any.
launch_other_app(app_name, event_name=None) ¶
Starts another application.
:param package_name: The package name of the application. :param event_name: The event triggering the app start, if any.
start_appium_session(event_name=None) ¶
Starts an Appium session.
:param event_name: The event triggering the session start, if any.