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.Optional capability
You can addappURL as an optional capability to specify which app to launch during a test run. Example values:
com.amazon.frenchpress.maincom.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.
The command lists connected devices and their serial numbers. Copy the serial number for the device you want to automate.
-
Set up capabilities.
-
Call the
driver.createSession()method and pass the desired capabilities. Example:A session is established and thedriverobject is ready to send automation commands to the target device.
Example Appium session
Here’s how an Appium session looks:End your Appium session
To end an Appium session and release any associated resources, call thedriver.quit(). To avoid resource leaks and issues with later test runs, end your session properly.

