SlideShare a Scribd company logo
Introduce Appium
@testotips.io
Twitter id: @Kazu_cocoa
Appium
?
Appium is an open source test
automation framework for use
with native, hybrid and mobile
web apps.
It drives iOS and Android apps
using the WebDriver protocol.
from: http://appium.io/
from: http://www.3pillarglobal.com/insights/appium-a-cross-browser-mobile-automation-tool
Integration TestUnit Test
Flow of automated test
GUI Test
Feature Test
(E2E Test)
GUI / Feature testing
Integration TestUnit Test
GUI Test
Feature Test
(E2E Test)
$ npm install appium
($ npm install -g appium)
node_module/.bin
appium.js
appium-doctor.js
authorize_ios.js
$ $(npm bin)appium
node_modules/appium/bin/appium.js
var appium = require('../lib/server/main.js');	
!
var startRepl = function () {	
var help = function () {	
console.log("nWelcome to the Appium CLI".cyan);	
console.log(" - Access the appium object via the object: 'appium'".grey);	
console.log(" - appium.run is the function to start the server".grey);	
console.log(" - args is the default params data structure".grey);	
console.log(" - set args.app then run appium.run(args);n".grey);	
return 'Thanks for asking';	
};	
!
help();	
!
var r = repl.start('(appium): ');	
r.context.appium = appium;	
r.context.parser = parser();	
r.context.help = help;	
r.context.args = {	
app: '/path/to/test/app'	
, udid: null	
, address: '127.0.0.1'	
, port: 4723	
};	
!
var connections = 0;	
var server = net.createServer(function (socket) {	
connections += 1;	
socket.setTimeout(5 * 60 * 1000, function () {	
socket.destroy();	
});	
repl.start("(appium): ", socket);	
}).listen(process.platform === "win32" ? ".pipenode-repl-sock-" + process.pid : "/tmp/node-repl-sock-" +
process.pid);	
!
r.on('exit', function () {	
server.close();	
process.exit();	
});
node_modules/appium/lib/server/main.js
var http = require('http')	
, express = require('express')	
, favicon = require('serve-favicon')	
, bodyParser = require('body-parser')	
, methodOverride = require('method-override')	
, morgan = require('morgan') // logger	
, routing = require('./routing.js')	
, path = require('path')	
, appium = require('../appium.js')	
, parserWrap = require('./middleware').parserWrap	
, appiumVer = require('../../package.json').version	
, appiumRev = null	
, async = require('async')	
, helpers = require('./helpers.js')	
, logFinalWarning = require('../helpers.js').logFinalDeprecationWarning	
, getConfig = require('../helpers.js').getAppiumConfig	
, allowCrossDomain = helpers.allowCrossDomain	
, catchAllHandler = helpers.catchAllHandler	
, checkArgs = helpers.checkArgs	
, configureServer = helpers.configureServer	
, startListening = helpers.startListening	
, conditionallyPreLaunch = helpers.conditionallyPreLaunch	
, prepareTmpDir = helpers.prepareTmpDir	
, requestStartLoggingFormat = require('./helpers.js').requestStartLoggingFormat	
, requestEndLoggingFormat = require('./helpers.js').requestEndLoggingFormat	
, domainMiddleware = require('./helpers.js').domainMiddleware;
var loggerjs = require('./server/logger.js')	
, logger = loggerjs.get('appium')	
, UUID = require('uuid-js')	
, _ = require('underscore')	
, Capabilities = require('./server/capabilities')	
, IOS = require('./devices/ios/ios.js')	
, Safari = require('./devices/ios/safari.js')	
, Android = require('./devices/android/android.js')	
, Selendroid = require('./devices/android/selendroid.js')	
, Chrome = require('./devices/android/chrome.js')	
, FirefoxOs = require('./devices/firefoxos/firefoxos.js')	
, jwpResponse = require('./devices/common.js').jwpResponse	
, status = require("./server/status.js");	
!
var DT_IOS = "ios"	
, DT_SAFARI = "safari"	
, DT_ANDROID = "android"	
, DT_CHROME = "chrome"	
, DT_SELENDROID = "selendroid"	
, DT_FIREFOX_OS = "firefoxos";	
node_modules/appium/lib/appium.js
!
node_modules/appium/lib/server/capabilities.js
var _ = require('underscore')	
, logger = require('./logger.js').get('appium')	
, warnDeprecated = require('../helpers.js').logDeprecationWarning;	
!
var capsConversion = {...};	
!
var okObjects = [...];	
!
var requiredCaps = [...];	
!
var strictRequiredCaps = [...];	
!
var generalCaps = strictRequiredCaps.concat([...]);	
!
var androidCaps = [...];	
!
var iosCaps = [...];
Appium
meets
iOS
Capabilities
IOS_CAPS_81 = {
automationName: 'Appium',
platformName: :ios,
platformVersion: '8.1',
deviceName: 'iPhone 6 Plus',
app: IOS_APP_PATH,
bundleId: APP_BUNDLE_ID,
!
calendarFormat: 'gregorian',
!
sendKeyStrategy: 'grouped'
!
localizableStringsDir: 'ja.lproj',
language: 'ja',
locale: 'ja_JP',
!
screenshotWaitTimeout: 20
}
create new plist before start app
appium/lib/devices/ios/ios.js
IOS.prototype.setDeviceTypeInInfoPlist = function (cb) {	
var plist = path.resolve(this.args.app, "Info.plist");	
var dString = this.getDeviceString();	
var isiPhone = dString.toLowerCase().indexOf("ipad") === -1;	
var deviceTypeCode = isiPhone ? 1 : 2;	
parsePlistFile(plist, function (err, obj) {	
if (err) {	
logger.error("Could not set the device type in Info.plist");	
return cb(err, null);	
} else {	
var newPlist;	
obj.UIDeviceFamily = [deviceTypeCode];	
if (binaryPlist) {	
newPlist = bplistCreate(obj);	
} else {	
newPlist = xmlplist.build(obj);	
}	
fs.writeFile(plist, newPlist, function (err) {	
if (err) {	
logger.error("Could not save new Info.plist");	
cb(err);	
} else {	
logger.debug("Wrote new app Info.plist with device type");	
cb();	
}	
}.bind(this));	
}	
}.bind(this));	
};
Appium
meets
Android
Capabilities
ANDROID_CAPS = {
automationName: 'Appium',
platformName: :android,
platformVersion: '4.2',
deviceName: ‘Android’,
app: ANDROID_APP_PATH,
!
unicodeKeyboard: true,
!
fullReset: true,
screenshotWaitTimeout: 20
}
appium/lib/devices/android/android.js
Android.prototype.pushAppium = function (cb) {	
logger.debug("Pushing appium bootstrap to device...");	
var binPath = path.resolve(__dirname, "..", "..", "..", "build",	
"android_bootstrap", "AppiumBootstrap.jar");	
fs.stat(binPath, function (err) {	
if (err) {	
cb(new Error("Could not find AppiumBootstrap.jar; please run " +	
"'grunt buildAndroidBootstrap'"));	
} else {	
this.adb.push(binPath, this.remoteTempPath(), cb);	
}	
}.bind(this));	
};	
!
Android.prototype.startApp = function (args, cb) {	
if (args.androidCoverage) {	
this.adb.androidCoverage(args.androidCoverage, args.appWaitPackage,	
args.appWaitActivity, cb);	
} else {	
this.adb.startApp({	
pkg: args.appPackage,	
activity: args.appActivity,	
action: args.intentAction,	
category: args.intentCategory,	
flags: args.intentFlags,	
waitPkg: args.appWaitPackage,	
waitActivity: args.appWaitActivity,	
optionalIntentArguments: args.optionalIntentArguments,	
stopApp: args.stopAppOnReset	
}, cb);	
}	
};
appium/lib/devices/android/bootstrap/
例えば、UiDeviceのpressBack()を使う
Common
Selectors
exports.checkValidLocStrat = function (strat, includeWeb, cb) {	
if (typeof includeWeb === "undefined") {	
includeWeb = false;	
}	
var validStrats = [	
'xpath',	
'id',	
'name',	
'class name'	
];	
var nativeStrats = [	
'-ios uiautomation',	
'accessibility id',	
'-android uiautomator'	
];	
var webStrats = [	
'link text',	
'css selector',	
'tag name',	
'partial link text'	
];	
var nativeDeprecations = {};	
var webDeprecations = {};	
var deprecations = {name: 'accessibility id'};
XPath
find_element :xpath, ”なんらかのXPath"
accessibility id
find_element :accessibility_id, ”なんらかの要素"
css selector
find_element :css_selector, ”なんらかの要素"
# Ruby Client使用時
iOS: UIAutomation
find_element :uiautomator,
"new UiSelector()
.className("android.widget.TextView")
.text("#{element_name}");”
find_element :uiautomation,
”$.mainApp().alert().buttons()[‘#{text}'];"
Android: uiautomator
Run test
concurrently
Appium is just server
Appium1: $appium -p 4723 &
Appium2: $appium -p 4725 -bp 4726 &
Appium1
iOS App Android
Appium
appium_server
= “http://127.0.0.1: 4723”
appium_server
= “http://127.0.0.1: 4725”
adb: 4726
Fin
One more tip
DroidDriver
DroidDriver
• Clone from Google to SauceLab(Appium)
• https://github.com/appium/droiddriver
• UiDeviceとか、UiElementとか使ってそう
• https://github.com/appium/droiddriver/tree/master/droiddriver-
android_support_test
• android-support-test libraryと並行して使うユースケースもある
が、android-support-test libraryはまだ開発されて日が浅いので
optionとしての統合に留められている
Thanks

More Related Content

What's hot

Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)
Sauce Labs
 
Appium: Mobile Automation Made Awesome
Appium: Mobile Automation Made AwesomeAppium: Mobile Automation Made Awesome
Appium: Mobile Automation Made Awesome
Netcetera
 
Appium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriverAppium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriver
Andrii Dzynia
 

What's hot (20)

What's New With Appium? From 1.0 to Now
What's New With Appium? From 1.0 to NowWhat's New With Appium? From 1.0 to Now
What's New With Appium? From 1.0 to Now
 
Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)Using Selenium to Test Native Apps (Wait, you can do that?)
Using Selenium to Test Native Apps (Wait, you can do that?)
 
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn ToànTech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
 
Introduction To Appium With Robotframework
Introduction To Appium With RobotframeworkIntroduction To Appium With Robotframework
Introduction To Appium With Robotframework
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
Appium
AppiumAppium
Appium
 
Appium
AppiumAppium
Appium
 
Appium: Mobile Automation Made Awesome
Appium: Mobile Automation Made AwesomeAppium: Mobile Automation Made Awesome
Appium: Mobile Automation Made Awesome
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using Appium
 
Appium basics
Appium basicsAppium basics
Appium basics
 
Mobile automation testing with selenium and appium
Mobile automation testing with selenium and appiumMobile automation testing with selenium and appium
Mobile automation testing with selenium and appium
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
 
Automated UI Testing Frameworks
Automated UI Testing FrameworksAutomated UI Testing Frameworks
Automated UI Testing Frameworks
 
Appium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriverAppium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriver
 
Future of Mobile Automation, Appium Steals it
Future of Mobile Automation, Appium Steals itFuture of Mobile Automation, Appium Steals it
Future of Mobile Automation, Appium Steals it
 
Getting Started with Mobile Test Automation & Appium
Getting Started with Mobile Test Automation & AppiumGetting Started with Mobile Test Automation & Appium
Getting Started with Mobile Test Automation & Appium
 
Android Automation Testing with Selendroid
Android Automation Testing with SelendroidAndroid Automation Testing with Selendroid
Android Automation Testing with Selendroid
 
Appium
AppiumAppium
Appium
 
Mobile Automation with Appium
Mobile Automation with AppiumMobile Automation with Appium
Mobile Automation with Appium
 
Mobile Test Automation - Appium
Mobile Test Automation - AppiumMobile Test Automation - Appium
Mobile Test Automation - Appium
 

Similar to 20150319 testotipsio

Compatibility Detector Tool of Chrome extensions
Compatibility Detector Tool of Chrome extensionsCompatibility Detector Tool of Chrome extensions
Compatibility Detector Tool of Chrome extensions
Kai Cui
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
Alex Su
 
WebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.jsWebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.js
Robert Nyman
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
Ben Lin
 
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Robert Nyman
 

Similar to 20150319 testotipsio (20)

Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node js
 
Non Conventional Android Programming En
Non Conventional Android Programming EnNon Conventional Android Programming En
Non Conventional Android Programming En
 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)
 
Artem Yavorsky "99 ways to take away your ugly polyfills"
Artem Yavorsky "99 ways to take away your ugly polyfills"Artem Yavorsky "99 ways to take away your ugly polyfills"
Artem Yavorsky "99 ways to take away your ugly polyfills"
 
JavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best PracticesJavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best Practices
 
Reliable Javascript
Reliable Javascript Reliable Javascript
Reliable Javascript
 
Compatibility Detector Tool of Chrome extensions
Compatibility Detector Tool of Chrome extensionsCompatibility Detector Tool of Chrome extensions
Compatibility Detector Tool of Chrome extensions
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
WebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.jsWebAPIs & WebRTC - Spotify/sthlm.js
WebAPIs & WebRTC - Spotify/sthlm.js
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
 
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
 
NodeJs
NodeJsNodeJs
NodeJs
 
Pengenalan blaast platform sdk
Pengenalan blaast platform sdkPengenalan blaast platform sdk
Pengenalan blaast platform sdk
 
Designing REST API automation tests in Kotlin
Designing REST API automation tests in KotlinDesigning REST API automation tests in Kotlin
Designing REST API automation tests in Kotlin
 
Phone gap 12 things you should know
Phone gap 12 things you should knowPhone gap 12 things you should know
Phone gap 12 things you should know
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with Express
 
Mobile automation using Appium
Mobile automation using AppiumMobile automation using Appium
Mobile automation using Appium
 
AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)
AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)
AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)
 
ParisJS #10 : RequireJS
ParisJS #10 : RequireJSParisJS #10 : RequireJS
ParisJS #10 : RequireJS
 

More from Kazuaki Matsuo

More from Kazuaki Matsuo (20)

2022-jasst-tohoku.pdf
2022-jasst-tohoku.pdf2022-jasst-tohoku.pdf
2022-jasst-tohoku.pdf
 
Add new commands in appium 2.0
Add new commands in appium 2.0Add new commands in appium 2.0
Add new commands in appium 2.0
 
Manage appium dependencies with -appium-home in appium 2.0
Manage appium dependencies with  -appium-home in appium 2.0Manage appium dependencies with  -appium-home in appium 2.0
Manage appium dependencies with -appium-home in appium 2.0
 
20210616-career-example-at-icare
20210616-career-example-at-icare20210616-career-example-at-icare
20210616-career-example-at-icare
 
Chrome Devtools Protocol via Selenium/Appium (English)
Chrome Devtools Protocol via Selenium/Appium (English)Chrome Devtools Protocol via Selenium/Appium (English)
Chrome Devtools Protocol via Selenium/Appium (English)
 
Chrome Devtools Protocol via Selenium/Appium (Japanese)
Chrome Devtools Protocol via Selenium/Appium (Japanese)Chrome Devtools Protocol via Selenium/Appium (Japanese)
Chrome Devtools Protocol via Selenium/Appium (Japanese)
 
Xcode 11におけるXCUITestの挙動
Xcode 11におけるXCUITestの挙動Xcode 11におけるXCUITestの挙動
Xcode 11におけるXCUITestの挙動
 
20191130 system-automation-conference
20191130 system-automation-conference20191130 system-automation-conference
20191130 system-automation-conference
 
Uncovering breaking changes behind UI on mobile applications
Uncovering breaking changes behind UI on mobile applicationsUncovering breaking changes behind UI on mobile applications
Uncovering breaking changes behind UI on mobile applications
 
Start contributing to OSS projects on your way
Start contributing to OSS projects on your wayStart contributing to OSS projects on your way
Start contributing to OSS projects on your way
 
Go ahead outside Japan
Go ahead outside JapanGo ahead outside Japan
Go ahead outside Japan
 
CookpadTechConf2018-(Mobile)TestAutomation
CookpadTechConf2018-(Mobile)TestAutomationCookpadTechConf2018-(Mobile)TestAutomation
CookpadTechConf2018-(Mobile)TestAutomation
 
20171215 andoird-test-night
20171215 andoird-test-night20171215 andoird-test-night
20171215 andoird-test-night
 
20170726 ios test_night_no
20170726 ios test_night_no20170726 ios test_night_no
20170726 ios test_night_no
 
20170701 lets-step-into-the-oss-community
20170701 lets-step-into-the-oss-community20170701 lets-step-into-the-oss-community
20170701 lets-step-into-the-oss-community
 
20170613 tech easy
20170613 tech easy20170613 tech easy
20170613 tech easy
 
20170529 clem kazuaki_matsuo
20170529 clem kazuaki_matsuo20170529 clem kazuaki_matsuo
20170529 clem kazuaki_matsuo
 
20150423 m3
20150423 m320150423 m3
20150423 m3
 
20170302 tryswift tasting_tests
20170302 tryswift tasting_tests20170302 tryswift tasting_tests
20170302 tryswift tasting_tests
 
20161126 to ruby
20161126 to ruby20161126 to ruby
20161126 to ruby
 

Recently uploaded

Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
mbmh111980
 

Recently uploaded (20)

Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdf
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 

20150319 testotipsio

  • 4. Appium is an open source test automation framework for use with native, hybrid and mobile web apps. It drives iOS and Android apps using the WebDriver protocol. from: http://appium.io/
  • 6. Integration TestUnit Test Flow of automated test GUI Test Feature Test (E2E Test)
  • 7. GUI / Feature testing Integration TestUnit Test GUI Test Feature Test (E2E Test)
  • 8. $ npm install appium ($ npm install -g appium)
  • 11. node_modules/appium/bin/appium.js var appium = require('../lib/server/main.js'); ! var startRepl = function () { var help = function () { console.log("nWelcome to the Appium CLI".cyan); console.log(" - Access the appium object via the object: 'appium'".grey); console.log(" - appium.run is the function to start the server".grey); console.log(" - args is the default params data structure".grey); console.log(" - set args.app then run appium.run(args);n".grey); return 'Thanks for asking'; }; ! help(); ! var r = repl.start('(appium): '); r.context.appium = appium; r.context.parser = parser(); r.context.help = help; r.context.args = { app: '/path/to/test/app' , udid: null , address: '127.0.0.1' , port: 4723 }; ! var connections = 0; var server = net.createServer(function (socket) { connections += 1; socket.setTimeout(5 * 60 * 1000, function () { socket.destroy(); }); repl.start("(appium): ", socket); }).listen(process.platform === "win32" ? ".pipenode-repl-sock-" + process.pid : "/tmp/node-repl-sock-" + process.pid); ! r.on('exit', function () { server.close(); process.exit(); });
  • 12. node_modules/appium/lib/server/main.js var http = require('http') , express = require('express') , favicon = require('serve-favicon') , bodyParser = require('body-parser') , methodOverride = require('method-override') , morgan = require('morgan') // logger , routing = require('./routing.js') , path = require('path') , appium = require('../appium.js') , parserWrap = require('./middleware').parserWrap , appiumVer = require('../../package.json').version , appiumRev = null , async = require('async') , helpers = require('./helpers.js') , logFinalWarning = require('../helpers.js').logFinalDeprecationWarning , getConfig = require('../helpers.js').getAppiumConfig , allowCrossDomain = helpers.allowCrossDomain , catchAllHandler = helpers.catchAllHandler , checkArgs = helpers.checkArgs , configureServer = helpers.configureServer , startListening = helpers.startListening , conditionallyPreLaunch = helpers.conditionallyPreLaunch , prepareTmpDir = helpers.prepareTmpDir , requestStartLoggingFormat = require('./helpers.js').requestStartLoggingFormat , requestEndLoggingFormat = require('./helpers.js').requestEndLoggingFormat , domainMiddleware = require('./helpers.js').domainMiddleware;
  • 13. var loggerjs = require('./server/logger.js') , logger = loggerjs.get('appium') , UUID = require('uuid-js') , _ = require('underscore') , Capabilities = require('./server/capabilities') , IOS = require('./devices/ios/ios.js') , Safari = require('./devices/ios/safari.js') , Android = require('./devices/android/android.js') , Selendroid = require('./devices/android/selendroid.js') , Chrome = require('./devices/android/chrome.js') , FirefoxOs = require('./devices/firefoxos/firefoxos.js') , jwpResponse = require('./devices/common.js').jwpResponse , status = require("./server/status.js"); ! var DT_IOS = "ios" , DT_SAFARI = "safari" , DT_ANDROID = "android" , DT_CHROME = "chrome" , DT_SELENDROID = "selendroid" , DT_FIREFOX_OS = "firefoxos"; node_modules/appium/lib/appium.js
  • 14. ! node_modules/appium/lib/server/capabilities.js var _ = require('underscore') , logger = require('./logger.js').get('appium') , warnDeprecated = require('../helpers.js').logDeprecationWarning; ! var capsConversion = {...}; ! var okObjects = [...]; ! var requiredCaps = [...]; ! var strictRequiredCaps = [...]; ! var generalCaps = strictRequiredCaps.concat([...]); ! var androidCaps = [...]; ! var iosCaps = [...];
  • 16. Capabilities IOS_CAPS_81 = { automationName: 'Appium', platformName: :ios, platformVersion: '8.1', deviceName: 'iPhone 6 Plus', app: IOS_APP_PATH, bundleId: APP_BUNDLE_ID, ! calendarFormat: 'gregorian', ! sendKeyStrategy: 'grouped' ! localizableStringsDir: 'ja.lproj', language: 'ja', locale: 'ja_JP', ! screenshotWaitTimeout: 20 }
  • 17. create new plist before start app appium/lib/devices/ios/ios.js IOS.prototype.setDeviceTypeInInfoPlist = function (cb) { var plist = path.resolve(this.args.app, "Info.plist"); var dString = this.getDeviceString(); var isiPhone = dString.toLowerCase().indexOf("ipad") === -1; var deviceTypeCode = isiPhone ? 1 : 2; parsePlistFile(plist, function (err, obj) { if (err) { logger.error("Could not set the device type in Info.plist"); return cb(err, null); } else { var newPlist; obj.UIDeviceFamily = [deviceTypeCode]; if (binaryPlist) { newPlist = bplistCreate(obj); } else { newPlist = xmlplist.build(obj); } fs.writeFile(plist, newPlist, function (err) { if (err) { logger.error("Could not save new Info.plist"); cb(err); } else { logger.debug("Wrote new app Info.plist with device type"); cb(); } }.bind(this)); } }.bind(this)); };
  • 19. Capabilities ANDROID_CAPS = { automationName: 'Appium', platformName: :android, platformVersion: '4.2', deviceName: ‘Android’, app: ANDROID_APP_PATH, ! unicodeKeyboard: true, ! fullReset: true, screenshotWaitTimeout: 20 }
  • 20. appium/lib/devices/android/android.js Android.prototype.pushAppium = function (cb) { logger.debug("Pushing appium bootstrap to device..."); var binPath = path.resolve(__dirname, "..", "..", "..", "build", "android_bootstrap", "AppiumBootstrap.jar"); fs.stat(binPath, function (err) { if (err) { cb(new Error("Could not find AppiumBootstrap.jar; please run " + "'grunt buildAndroidBootstrap'")); } else { this.adb.push(binPath, this.remoteTempPath(), cb); } }.bind(this)); }; ! Android.prototype.startApp = function (args, cb) { if (args.androidCoverage) { this.adb.androidCoverage(args.androidCoverage, args.appWaitPackage, args.appWaitActivity, cb); } else { this.adb.startApp({ pkg: args.appPackage, activity: args.appActivity, action: args.intentAction, category: args.intentCategory, flags: args.intentFlags, waitPkg: args.appWaitPackage, waitActivity: args.appWaitActivity, optionalIntentArguments: args.optionalIntentArguments, stopApp: args.stopAppOnReset }, cb); } };
  • 22.
  • 25. exports.checkValidLocStrat = function (strat, includeWeb, cb) { if (typeof includeWeb === "undefined") { includeWeb = false; } var validStrats = [ 'xpath', 'id', 'name', 'class name' ]; var nativeStrats = [ '-ios uiautomation', 'accessibility id', '-android uiautomator' ]; var webStrats = [ 'link text', 'css selector', 'tag name', 'partial link text' ]; var nativeDeprecations = {}; var webDeprecations = {}; var deprecations = {name: 'accessibility id'};
  • 26. XPath find_element :xpath, ”なんらかのXPath" accessibility id find_element :accessibility_id, ”なんらかの要素" css selector find_element :css_selector, ”なんらかの要素" # Ruby Client使用時
  • 27. iOS: UIAutomation find_element :uiautomator, "new UiSelector() .className("android.widget.TextView") .text("#{element_name}");” find_element :uiautomation, ”$.mainApp().alert().buttons()[‘#{text}'];" Android: uiautomator
  • 29. Appium is just server Appium1: $appium -p 4723 & Appium2: $appium -p 4725 -bp 4726 & Appium1 iOS App Android Appium appium_server = “http://127.0.0.1: 4723” appium_server = “http://127.0.0.1: 4725” adb: 4726
  • 30. Fin
  • 33. DroidDriver • Clone from Google to SauceLab(Appium) • https://github.com/appium/droiddriver • UiDeviceとか、UiElementとか使ってそう • https://github.com/appium/droiddriver/tree/master/droiddriver- android_support_test • android-support-test libraryと並行して使うユースケースもある が、android-support-test libraryはまだ開発されて日が浅いので optionとしての統合に留められている