Skip to content

Appium Tizen Driver is a test automation tool for Tizen devices. Appium Tizen Driver automates xamarin apps, tested on emulators and real devices. Appium Tizen Driver is part of the Appium mobile test automation tool.

License

Notifications You must be signed in to change notification settings

erdncyz/appium-tizen-driver

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

77 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Appium Tizen Driver

NPM version Downloads License Appium

๐Ÿš€ Modern Appium 2.x Driver for Tizen Devices

Appium Tizen Driver is a comprehensive test automation solution for Samsung Tizen devices and applications. This driver enables automated testing of Tizen applications on both emulators and real devices, providing full compatibility with the latest Appium 2.x framework and W3C WebDriver standards.

โœจ Key Features

  • ๐Ÿ”ฅ Appium 2.x Full Compatibility - Built for modern Appium architecture
  • ๐ŸŒ W3C WebDriver Support - Industry-standard capabilities format
  • ๐Ÿ“ฑ Tizen Device Support - Works with emulators and real Tizen devices
  • ๐ŸŽฏ Comprehensive Automation - Touch, gesture, element interaction, and more
  • ๐Ÿš€ High Performance - Optimized for fast and reliable test execution
  • ๐Ÿ”ง Easy Integration - Simple setup and configuration
  • ๐Ÿ“Š Rich Logging - Detailed debugging and monitoring capabilities

๐ŸŽฏ What is Tizen?

Tizen is Samsung's open-source operating system for smart devices, including:

  • ๐Ÿ“บ Smart TVs - Samsung Smart TV applications
  • โŒš Wearables - Samsung Galaxy Watch applications
  • ๐Ÿ“ฑ Mobile Devices - Samsung Z series phones
  • ๐Ÿ  IoT Devices - Smart home and IoT applications

This driver enables automated testing of applications running on all Tizen platforms.

๐Ÿš€ Quick Start

Step 1: Install Appium 2.x

npm install -g appium@latest

Step 2: Install Tizen Driver

# Note: appium driver install may not work for custom drivers
# If you get an error, use one of the alternative methods below

# Method 1: Install from GitHub (Recommended)
git clone https://github.com/erdncyz/appium-tizen-driver.git
cd appium-tizen-driver
npm install
npm run build
npm link

# Method 2: Install from NPM and link manually
npm install @erdncyz/appium-tizen-driver
cd node_modules/@erdncyz/appium-tizen-driver
npm link

# Method 3: Try official Appium driver install (may fail for custom drivers)
appium driver install @erdncyz/appium-tizen-driver
appium driver install --source=npm @erdncyz/appium-tizen-driver

Step 3: Start Appium Server

# Start with Tizen driver
appium server --use-drivers=tizen

# Start with custom port
appium server --use-drivers=tizen --port 4724

# Test server status
curl -X GET http://localhost:4724/status

Step 4: Run Your Tests

// Your test code here
const capabilities = {
  "capabilities": {
    "alwaysMatch": {
      "platformName": "Tizen",
      "appium:automationName": "Tizen",
      "appium:appPackage": "com.samsung.example",
      "appium:deviceName": "TizenDevice"
    }
  }
};

๐Ÿ“ฆ Installation Options

Appium 2.x (Recommended)

# Method 1: Install from GitHub (Recommended)
git clone https://github.com/erdncyz/appium-tizen-driver.git
cd appium-tizen-driver
npm install
npm run build
npm link

# Method 2: Install from NPM and link manually
npm install @erdncyz/appium-tizen-driver
cd node_modules/@erdncyz/appium-tizen-driver
npm link

# Method 3: Try official Appium driver install (may fail for custom drivers)
appium driver install @erdncyz/appium-tizen-driver

# Method 4: Install globally (not recommended for Appium 2.x)
npm install -g @erdncyz/appium-tizen-driver

From Local Directory

# Install from local development version
appium driver install /path/to/appium-tizen-driver

Appium 1.x (Legacy Support)

npm install -g @erdncyz/appium-tizen-driver

๐ŸŽฏ Usage Examples

Starting Appium Server

# Start with Tizen driver
appium server --use-drivers=tizen

# Start with custom port
appium server --use-drivers=tizen --port 4724

# Start with base path
appium server --use-drivers=tizen --base-path /wd/hub

# Test server status
curl -X GET http://localhost:4724/status

W3C Capabilities (Appium 2.x - Recommended)

Basic Example

const capabilities = {
  "capabilities": {
    "alwaysMatch": {
      "platformName": "Tizen",
      "appium:automationName": "Tizen",
      "appium:appPackage": "com.samsung.example",
      "appium:deviceName": "TizenDevice"
    },
    "firstMatch": [{}]
  }
};

Complete Example with WebDriverIO

const { remote } = require('webdriverio');

const capabilities = {
  "capabilities": {
    "alwaysMatch": {
      "platformName": "Tizen",
      "appium:automationName": "Tizen",
      "appium:appPackage": "com.samsung.example",
      "appium:deviceName": "TizenDevice",
      "appium:tizenInstallTimeout": 90000,
      "appium:sdbPort": 26101
    },
    "firstMatch": [{}]
  }
};

const driver = await remote({
  hostname: 'localhost',
  port: 4723,
  path: '/wd/hub',
  capabilities: capabilities.capabilities,
  logLevel: 'info'
});

// Your test code here
await driver.$('~button').click();
await driver.pause(2000);
await driver.deleteSession();

Using Selenium WebDriver

const { Builder } = require('selenium-webdriver');

const capabilities = {
  "platformName": "Tizen",
  "appium:automationName": "Tizen",
  "appium:appPackage": "com.samsung.example",
  "appium:deviceName": "TizenDevice"
};

const driver = await new Builder()
  .usingServer('http://localhost:4723/wd/hub')
  .withCapabilities(capabilities)
  .build();

// Your test code here
await driver.quit();

Legacy MJSONWP Format (Appium 1.x)

import { TizenDriver } from '@erdncyz/appium-tizen-driver';

let defaultCaps = {
  appPackage: 'com.samsung.example',
  deviceName: 'Tizen',
  platformName: 'Tizen'
};

let driver = new TizenDriver();
await driver.createSession(defaultCaps);

๐Ÿ”ง System Requirements

Software Requirements

  • Appium: 2.0.0 or higher (recommended) or 1.22.0+ (legacy)
  • Node.js: 14.0.0 or higher
  • Tizen Studio: For SDB (Smart Development Bridge) communication
  • Java Runtime: Required for Tizen Studio tools

Hardware Requirements

  • Tizen Device: Emulator or real device with Developer Mode enabled
  • USB Connection: For real device testing
  • Network Connection: For emulator testing

Tizen Studio Setup

  1. Download Tizen Studio: https://developer.tizen.org/development/tizen-studio/download
  2. Install SDB Tools: Package Manager โ†’ Tools โ†’ SDB
  3. Enable Developer Mode: On your Tizen device
  4. Connect Device: Via USB or network

Device Setup

# Check if device is connected
sdb devices

# Enable developer mode (if needed)
sdb shell tizen security-profiles add active profile

# Install test app (example)
sdb install /path/to/your/app.tpk

โš™๏ธ Capabilities Configuration

Required Capabilities

Capability Type Description Example
platformName String Platform name (must be 'Tizen') "Tizen"
appium:automationName String Automation engine (must be 'Tizen') "Tizen"
appium:appPackage String Package identifier of the Tizen app "com.samsung.example"
appium:deviceName String Name of the Tizen device "TizenDevice"

Optional Capabilities

Capability Type Default Description Example
appium:tizenInstallTimeout Number 60000 App installation timeout in milliseconds 90000
appium:sdbPort Number 26101 SDB connection port 26101
appium:fullReset Boolean false Full reset of the device true
appium:noReset Boolean false Don't reset app state true
appium:fastReset Boolean true Fast reset (default) false

Capabilities Example

const capabilities = {
  "capabilities": {
    "alwaysMatch": {
      // Required capabilities
      "platformName": "Tizen",
      "appium:automationName": "Tizen",
      "appium:appPackage": "com.samsung.example",
      "appium:deviceName": "TizenDevice",
      
      // Optional capabilities
      "appium:tizenInstallTimeout": 90000,
      "appium:sdbPort": 26101,
      "appium:fullReset": false,
      "appium:noReset": false
    }
  }
};

Changelog

v2.0.0 (2024)

  • ๐Ÿš€ MAJOR: Full Appium 2.x compatibility
  • โœจ NEW: W3C WebDriver capabilities support
  • โœจ NEW: Modern Appium 2.x driver architecture
  • ๐Ÿ”ง IMPROVED: Enhanced capabilities parsing and validation
  • ๐Ÿ”ง IMPROVED: Better error handling and debugging
  • โšก PERFORMANCE: Optimized session creation process
  • ๐Ÿ› ๏ธ TECHNICAL: Updated dependencies for Appium 2.x
  • ๐Ÿ› ๏ธ TECHNICAL: Migrated to latest BaseDriver version

v1.x (Legacy)

  • Original Appium 1.x implementation

๐ŸŽฎ Available Commands

The Tizen Driver provides comprehensive automation capabilities for Tizen applications:

Element Interaction

Command Description Example
click() Click on element await element.click()
getAttribute() Get element attribute await element.getAttribute('text')
setAttribute() Set element attribute await element.setAttribute('value', 'text')
getText() Get element text await element.getText()
setValue() Set element value await element.setValue('text')
clear() Clear element value await element.clear()
isEnabled() Check if element is enabled await element.isEnabled()
isDisplayed() Check if element is displayed await element.isDisplayed()
getSize() Get element size await element.getSize()
getLocation() Get element location await element.getLocation()

Touch & Gesture Actions

Command Description Example
tap() Tap on coordinates await driver.tap([100, 200])
touchUp() Touch up action await driver.touchUp(100, 200)
touchDown() Touch down action await driver.touchDown(100, 200)
touchMove() Touch move action await driver.touchMove(100, 200)
touchLongClick() Long press await driver.touchLongClick(100, 200, 2000)
swipe() Swipe gesture await driver.swipe(100, 200, 300, 400)
flick() Flick gesture await driver.flick(100, 200, 300, 400, 100)
performTouch() Custom touch action await driver.performTouch([{action: 'press', x: 100, y: 200}])

App Management

Command Description Example
installApp() Install app await driver.installApp('/path/to/app.tpk')
removeApp() Remove app await driver.removeApp('com.samsung.example')
isAppInstalled() Check if app installed await driver.isAppInstalled('com.samsung.example')
launchApp() Launch app await driver.launchApp()
startApp() Start app await driver.startApp()
closeApp() Close app await driver.closeApp()
isStartedApp() Check if app started await driver.isStartedApp()

Device & System

Command Description Example
getDeviceTime() Get device time await driver.getDeviceTime()
pressHardwareKey() Press hardware key await driver.pressHardwareKey('BACK')
back() Go back await driver.back()
takeScreenshot() Take screenshot await driver.takeScreenshot()
pullFile() Pull file from device await driver.pullFile('/path/to/file')

Element Finding

Command Description Example
findElement() Find single element await driver.findElement('id', 'button1')
findElements() Find multiple elements await driver.findElements('class', 'button')
getAutomationId() Get automation ID await element.getAutomationId()

Advanced Actions

Command Description Example
execute() Execute custom script await driver.execute('return document.title')
performGesture() Perform custom gesture await driver.performGesture([{action: 'press', x: 100, y: 200}])

๐Ÿ” Element Locators

The driver supports multiple locator strategies:

// By ID
await driver.findElement('id', 'button1');

// By Accessibility ID
await driver.findElement('accessibility id', 'login_button');

// By Class Name
await driver.findElement('class name', 'Button');

// By Name
await driver.findElement('name', 'Login Button');

๐Ÿšจ Troubleshooting

Common Issues & Solutions

1. Device Connection Issues

# Check if device is connected
sdb devices

# If no devices found, try:
sdb kill-server
sdb start-server
sdb devices

2. App Installation Errors

# Check if app is already installed
sdb shell pm list packages | grep your.package.name

# Uninstall if needed
sdb uninstall your.package.name

# Install with verbose output
sdb install -v /path/to/app.tpk

3. Permission Issues

# Enable developer mode
sdb shell tizen security-profiles add active profile

# Grant permissions
sdb shell pm grant your.package.name android.permission.WRITE_EXTERNAL_STORAGE

4. Appium Server Issues

# Check Appium version
appium --version

# Update Appium
npm update -g appium

# Check driver installation
appium driver list

Error Messages & Solutions

Error Cause Solution
SessionNotCreatedError Invalid capabilities Check platformName and automationName
NoSuchElementError Element not found Verify element locator and timing
WebDriverException Device not connected Check SDB connection
TimeoutError Operation timeout Increase timeout values

โ“ FAQ

Q: What Tizen devices are supported?

A: All Tizen devices including Smart TVs, wearables, mobile devices, and IoT devices.

Q: Can I use this with Appium 1.x?

A: Yes, but Appium 2.x is recommended for full functionality and W3C support.

Q: How do I find my app's package name?

A: Use sdb shell pm list packages | grep your.app.name or check your app's manifest.

Q: What if my device is not detected?

A: Ensure Developer Mode is enabled and try restarting SDB server.

Q: Can I run tests on emulator?

A: Yes, both Tizen emulator and real devices are supported.

Q: How do I update the driver?

A: Run appium driver update @erdncyz/appium-tizen-driver

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Clone the repository
git clone https://github.com/erdncyz/appium-tizen-driver.git
cd appium-tizen-driver

# Install dependencies
npm install

# Run tests
npm test

# Build the project
npm run build

๐Ÿ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Original Samsung Appium Tizen Driver team
  • Appium community for the excellent framework
  • Tizen developer community for support and feedback

โญ If this project helps you, please give it a star on GitHub!

About

Appium Tizen Driver is a test automation tool for Tizen devices. Appium Tizen Driver automates xamarin apps, tested on emulators and real devices. Appium Tizen Driver is part of the Appium mobile test automation tool.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%