Manage Appium Sessions
The Appium Vega Driver uses a session-based model to manage the connection between your test automation scripts and the Appium Server. You must create and configure an Appium session with appropriate capabilities to automate your apps.
Understand the capabilities for Appium session
Before you create your first session, it's important to understand the capabilities for each Appium session.
The Appium session is the fundamental unit of interaction between your test code and the Appium Server. When you create a new session, you're establishing a connection to the server and defining the target device, platform, and the app you want to automate.
Required capabilities
The following table lists the specific device, platform, and app you want to automate to establish a successful connection.
Capability | Type | Required? | Description | Values |
---|---|---|---|---|
platformName |
string | yes | Specifies the platform type that hosts your app or browser. Set this to Vega when using Appium Vega Driver. |
Vega |
appium:automationName |
string | yes | Specifies the Appium driver name. Set this to automation-toolkit/JSON-RPC when using Appium Vega Driver. | automation-toolkit/JSON-RPC |
kepler:device |
string | yes | Specifies the device for test automation using the format <bridge>://<device serial> . Only the vda bridge is supported. If you connected only one device to the machine using Appium Vega Driver, you can use default as the device serial number. |
vda://default or vda://GXXXXXXXXXX |
Optional capability
You can add appURL
as optional capability to specify which app to launch during test run. Example values:
com.amazon.frenchpress.main
com.amazon.youtube.main
Create an Appium session
To create an Appium session for a Fire TV Stick, complete the following steps.
-
Get your device serial number.
vda devices
-
Set up capabilities.
device_serial = "<Your device serial>" desired_caps = { "platformName": "Vega", "appium:automationName": "automation-toolkit/JSON-RPC", "kepler:device": f"vda://{device_serial}" }
-
Call the
driver.createSession()
method and pass the desired capabilities.Example:
def appium_session(): appium_options = AppiumOptions() appium_options.load_capabilities(desired_caps) driver = webdriver.Remote('http://127.0.0.1:4723', options=appium_options)
Example Appium session
Here's how an Appium session looks:
device_serial = "<Your device serial>"
desired_caps = {
"platformName": "Vega",
"appium:automationName": "automation-toolkit/JSON-RPC",
"kepler:device": f"vda://{device_serial}"
}
def appium_session():
appium_options = AppiumOptions()
appium_options.load_capabilities(desired_caps)
driver = webdriver.Remote('http://127.0.0.1:4723', options=appium_options)
End your Appium session
To end an Appium session and release any associated resources, call the driver.quit()
. Failing to end your session properly can lead to resource leaks and issues with subsequent test runs.
Last updated: Sep 30, 2025