Appium Roku Driver is a test automation tool for Roku devices. Appium Roku Driver automates Roku applications, tested on real devices. Appium Roku Driver is part of the Appium test automation tool.
In order to use appium-roku-driver
, we need to use appium
version 1.16.0
or higher
npm i -g appium-roku-driver
Import Roku Driver, set and create a session:
import { RokuDriver } from "appium-roku-driver";
let capabilities = {
app: "/Users/my-computer/3_Grid.zip",
deviceName: "Home",
appId: "dev",
platformName: "Roku",
contentId: "MV005011860000",
mediaType: "season",
ip: "10.10.1.1",
username: "rokuUser",
password: "rokuPass",
};
let driver = new RokuDriver();
await driver.createSession(capabilities);
Desired capabilities (caps) are a set of keys and values (i.e., a map or hash) sent to the Appium server to tell the server what kind of automation session we’re interested in starting up. There are various capabilities that can modify the behavior of the server during automation.
Capability | Mandatory Fields | Description |
---|---|---|
app | ✅ |
The absolute local path or remote http URL to a .zip 1 |
appId | ✅ |
The appId is the identification for (channel / app) inside the OS |
deviceName | ✅ |
The kind of device to use 1 |
platformName | ✅ |
Platform target will be automated 1 |
contentId | ✅ |
Partner defined unique identifier for a specific piece of content 2 |
mediaType | ✅ |
Parameter to give context to the type of contentID passed 2 |
ip | ✅ |
Ip of the device on which the automation will be executed |
username | ✅ |
Username of device 3 |
password | ✅ |
Password of device 3 |
noReset | 🔲 |
Don't reset app state before this session. See in the osicial documentation of Appium for more details 4 |
fullReset | 🔲 |
Perform a complete reset. See in the osicial documentation of Appium for more details 4 |
newCommandTimeout | 🔲 |
How long (in seconds) Appium will wait for a new command from the client before assuming the client quit and ending the session 1 |
These commands are used for session administration.
createSession(capabilities);
deleteSession();
validateDesiredCaps(capabilities);
These commands are used for actions administration.
getPageSource();
getScreenshot();
These commands are used for application administration.
isAppInstalled(appId);
appsInstalled();
findAppInstalled(appId);
isCheckVersion(app, appId);
activateApp(appId, contentId, mediaType);
removeApp(appId);
terminateApp(appId);
installApp(app, username, password);
launchApp(appId, contentId, mediaType);
closeApp();
isStartedApp(appId);
isAppActivated(appId);
background(seconds);
getDeviceTime();
sendKey(key);
pressHardwareKey(key);
back();
isKeyboardShown();
hideKeyboard();