All Projects → AppiumTestDistribution → appium-device-farm

AppiumTestDistribution / appium-device-farm

Licence: MIT license
This is an Appium 2.0 plugin designed to manage and create driver sessions on available devices.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to appium-device-farm

appium-dashboard-plugin
Appium plugin that provides complete test logs, video recording of test and device logs(logcat and syslogs) for easy debugging.
Stars: ✭ 82 (-33.87%)
Mutual labels:  appium, appium-plugin
SHAFT ENGINE
SHAFT is an MIT licensed test automation engine. Powered by best-in-class frameworks like Selenium WebDriver, Appium & RestAssured it provides a wizard-like syntax to increase productivity, and built-in wrappers to eliminate boilerplate code and to ensure your tests are extra stable and your results are extra reliable.
Stars: ✭ 170 (+37.1%)
Mutual labels:  appium
Appium
Python Appium objectpage
Stars: ✭ 180 (+45.16%)
Mutual labels:  appium
Selion
Enabling Test Automation in Java
Stars: ✭ 252 (+103.23%)
Mutual labels:  appium
Winappdriver
Windows Application Driver
Stars: ✭ 2,577 (+1978.23%)
Mutual labels:  appium
web-ui
python+selenium+pytest+allure UI 自动化框架
Stars: ✭ 199 (+60.48%)
Mutual labels:  appium
Automationtest
自动化测试,支持接口自动化、WEB UI自动化、APP UI自动化、性能测试
Stars: ✭ 171 (+37.9%)
Mutual labels:  appium
appium-tests
Tool to run Titanium mobile tests in Appium
Stars: ✭ 15 (-87.9%)
Mutual labels:  appium
xappium.uitest
Xappium.UITest is a UITest helper framework built on top of Appium. This aims at making it easier to write and run UI Tests.
Stars: ✭ 60 (-51.61%)
Mutual labels:  appium
Autoline
建议你使用更新的AutoLink平台
Stars: ✭ 227 (+83.06%)
Mutual labels:  appium
Mastering Junit5
A comprehensive collection of test examples created with JUnit 5
Stars: ✭ 223 (+79.84%)
Mutual labels:  appium
Appium Uiautomator2 Server
Appium UiAutomator/UiObject2-based server for Android UI automation. This module is used by appium-uiautomator2-driver component
Stars: ✭ 196 (+58.06%)
Mutual labels:  appium
Bitpoll
A web application for scheduling meetings and general polling.
Stars: ✭ 182 (+46.77%)
Mutual labels:  polling
Selenium Jupiter
JUnit 5 extension for Selenium WebDriver
Stars: ✭ 185 (+49.19%)
Mutual labels:  appium
AppiumGrid
A framework for running appium tests in parallel across devices and also on desktop browser... U like it STAR it !!
Stars: ✭ 17 (-86.29%)
Mutual labels:  appium
Cerberus Source
User-friendly automated testing framework.
Stars: ✭ 172 (+38.71%)
Mutual labels:  appium
Appium
📱 Automation for iOS, Android, and Windows Apps.
Stars: ✭ 14,469 (+11568.55%)
Mutual labels:  appium
qlicker
Open Source Clicker
Stars: ✭ 23 (-81.45%)
Mutual labels:  polling
ios-ui-automation-overview
An overview of popular iOS UI testing solutions.
Stars: ✭ 23 (-81.45%)
Mutual labels:  appium
polling2
Powerful polling utility in Python
Stars: ✭ 49 (-60.48%)
Mutual labels:  polling

appium-device-farm


DeviceFarm


Build Status npm version

This is an Appium plugin designed to manage and create driver session on connected android devices and iOS Simulators.

Why Appium Device Farm?

  • Automatically detects connected Android, iOS Simulators and Real devices before session creation and maintains it in device pool.
  • Dynamically allocates a free device from device pool while creating driver session.
  • Updates the device pool with a new device during test execution.
  • Allocates random ports for parallel execution.
  • Remote execution

Device UI

  • Navigate to localhost:4723/device-farm once the appium server is started.

Prerequisite

Appium version 2.0.0-beta.43

Installation - Server

Install the plugin using Appium's plugin CLI, either as a named plugin or via NPM:

appium plugin install --source=npm appium-device-farm
appium plugin install --source=npm appium-dashboard

Installation - Client

No special action is needed to make things work on the client side.

Activation

The plugin will not be active unless turned on when invoking the Appium server. See "Argument options" below

appium server -ka 800 --use-plugins=device-farm,appium-dashboard  -pa /wd/hub --plugin-device-farm-platform=android

You can also pass all the arguments in a config file. Refer here

appium server -ka 800 --use-plugins=device-farm --config ./server-config.json -pa /wd/hub

Cloud Execution

Plugin currently supports pCloudy and BrowserStack

BrowserStack

BS_USERNAME="username" BS_PASSWORD="password" appium server -ka 800 --use-plugins=device-farm --config ./serverConfig/bs-config.json -pa /wd/hub

Refer on BroswerStack config here

pCloudy

PCLOUDY_APIKEY="apiKey" PCLOUDY_USERNAME="useremail" appium server -ka 800 --use-plugins=device-farm --config ./serverConfig/pcloudy-config.json -pa /wd/hub

Refer on pCloudy config here

Argument options

These arguments are set when you launch the Appium server, with this plugin installed.

Argument Required Description Default Options
plugin-device-farm-platform Yes Platform to run tests against for parallel execution None both,ios,android
plugin-device-farm-device-types No Types of devices to include both both,simulated,real
plugin-device-farm-skip-chrome-download No Downloads require chromedriver for web testing true false
Setting to false will download required chromedriver for web testing on chrome
plugin-device-farm-remote No Whether or not to include simulators/real devices from remote machine None remote: ["http://remotehost:remoteport"], If you want to run tests distributed across remote and local machine remote: ["http://remotehost:remoteport", "http://127.0.0.1"]
plugin-device-farm-max-sessions No Limit how many sessions can be active at a time. This is useful when you need limit sessions based on host machine resource availability. None <number> e.g. 8

Capabilities

Capability Name Description
appium:iPhoneOnly Allocate only iPhone simulators for execution when to true. Default value is false.
appium:iPadOnly Allocate only iPad simulators for execution when to true. Default value is false.
appium:deviceAvailabilityTimeout When create session requests are more than available connected devices, plugin waits for a certain interval for device availability before it timeout. Default value is 180000 milliseconds.
appium:deviceRetryInterval When create session requests are more than available connected devices, plugin polls for device availability in certain intervals. Default value is 10000 milliseconds.
appium:udids Comma separated list of device udid's to execute tests only on specific devices appium:udids: device1UDID,device2UDID
appium:platformVersion This capability is used to filter devices/simulators based on SDK. Only devices/simulators that are an exact match with the platformVerson would be considered for test run. appium:platformVersion is optional argument. ex: 'appium:platformVersion': 16.1.1
appium:minSDK This capability is used to filter devices/simulators based on SDK. Devices/Simulators with SDK greater then or equal to minSDK would only be considered for test run. appium:minSDK is optional argument. ex: 'appium:minSDK': 15

Custom chrome binary url

set the new URL to CHROMEDRIVER_CDNURL environment variable:

CHROMEDRIVER_CDNURL=http://npm.taobao.org/mirrors/chromedriver appium server -ka 800 --use-plugins=device-farm --config ./server-config.json -pa /wd/hub

Notes

  1. If there is no activity on a session for more then 100 seconds, device allocated to respective session would be unblocked and made available for new session requests.

Remote Execution

Check our Remote Execution Wiki for more details.

Example

Server logs will be as below:

Session Creation

[device-manager] Master Device List [{"busy":false,"state":"device","udid":"emulator-5554"},{"busy":false,"state":"device","udid":"emulator-5556"}]
[debug] [HTTP] Request idempotency key: 40f0c680-ba67-47a9-b763-95121afd2aff
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"app":"/Users/sekars/workspace/AppiumSample/VodQA.apk","automationName":"UIAutomator2","platformName":"Android","deviceName":"Android Emulator","newCommandTimeout":700000},"capabilities":{"firstMatch":[{"appium:app":"/Users/sekars/workspace/AppiumSample/VodQA.apk","appium:automationName":"UIAutomator2","appium:deviceName":"Android Emulator","appium:newCommandTimeout":700000,"platformName":"android"}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"app":"/Users/sekars/workspace/AppiumSample/VodQA.apk","automationName":"UIAutomator2","platformName":"Android","deviceName":"Android Emulator","newCommandTimeout":700000},null,{"firstMatch":[{"appium:app":"/Users/sekars/workspace/AppiumSample/VodQA.apk","appium:automationName":"UIAutomator2","appium:deviceName":"Android Emulator","appium:newCommandTimeout":700000,"platformName":"android"}]}]
[Appium] Plugins which can handle cmd 'createSession': device-manager (sessionless)
[Appium] Plugin device-manager (sessionless) is now handling cmd 'createSession'
[device-manager] Device UDID emulator-5554 is blocked for execution.
[Appium] Attempting to find matching driver for automationName 'UIAutomator2' and platformName 'android'
[Appium] The 'uiautomator2' driver was installed and matched caps.
[Appium] Will require it at /Users/sekars/.appium/appium-uiautomator2-driver/node_modules/appium-uiautomator2-driver
[Appium] Appium v2.0.0-beta.12 creating new AndroidUiautomator2Driver (v1.64.0) session
[Appium] Checking BaseDriver versions for Appium and AndroidUiautomator2Driver
[Appium] Appium's BaseDriver version is 8.0.0-beta.6
[Appium] Could not determine AndroidUiautomator2Driver's BaseDriver version
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "platformName": "android",
[debug] [BaseDriver]     "appium:app": "/Users/sekars/workspace/AppiumSample/VodQA.apk",
[debug] [BaseDriver]     "appium:automationName": "UIAutomator2",
[debug] [BaseDriver]     "appium:deviceName": "emulator-5554",
[debug] [BaseDriver]     "appium:newCommandTimeout": 700000,
[debug] [BaseDriver]     "appium:udid": "emulator-5554",
[debug] [BaseDriver]     "appium:systemPort": 64717
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: a18dbb34-b6b7-4269-b55d-d25854da2c69

Session Deletion

[device-manager] Unblocking device UDID: emulator-5554
[device-manager] Deleting Session and device UDID emulator-5554 is unblocked
[Appium] Executing default handling behavior for command 'deleteSession'
[debug] [BaseDriver] Event 'quitSessionRequested' logged at 1616393765527 (11:46:05 GMT+0530 (India Standard Time))
[Appium] Removing session a18dbb34-b6b7-4269-b55d-d25854da2c69 from our master session list
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [WD Proxy] Matched '/' to command name 'deleteSession'
[debug] [WD Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:64717/wd/hub/session/6312cab7-d11a-4bf5-92cf-39c4f85a4a8f] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"6312cab7-d11a-4bf5-92cf-39c4f85a4a8f","value":null}
[debug] [ADB] Running '/Users/sekars/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.vodqareactnative'
[debug] [BaseDriver] Event 'quitSessionFinished' logged at 1616393765610 (11:46:05 GMT+0530 (India Standard Time))
[debug] [W3C (20e35290)] Received response: null
[debug] [W3C (20e35290)] But deleting session, so not returning
[debug] [W3C (20e35290)] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /wd/hub/session/20e35290-43b2-431e-8a78-aefca4d092fb 200 491 ms - 14

Device polling for every 10 seconds

[ADB] Using 'adb' from '/Users/sekars/Library/Android/sdk/platform-tools/adb'
[debug] [ADB] Running '/Users/sekars/Library/Android/sdk/platform-tools/adb -P 5037 start-server'
[debug] [ADB] Getting connected devices
[debug] [ADB] Connected devices: [{"udid":"emulator-5554","state":"device"},{"udid":"emulator-5556","state":"device"}]
[device-manager] Master Device List [{"busy":false,"state":"device","udid":"emulator-5554"},{"busy":false,"state":"device","udid":"emulator-5556"}]

Big thanks to the following organizations for their support to the project with their open source licenses:

ATD

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].