Appium solution

  • View
    506

  • Download
    2

Embed Size (px)

Text of Appium solution

PowerPoint Presentation

Automation for Mobile Apps - Appium solutionAuthor:Nael Abd Aljawad QA Automation Technical Leader

Confidential and propriety Galil Software, Ltd. 2012 4-Jan-16

#

1

Mobile Automation Tools Comparison

Confidential and propriety Galil Software, Ltd. 2012 25.12.11

#Appium drives iOS and Android apps using the WebDriver protocol.Appium is an open source test automation framework for use with native, hybrid and mobile web apps.

Appium Solution

Confidential and propriety Galil Software, Ltd. 2012 25.12.11

#A native application (native app) is an application program that has been developed for use on a particular platform or device. (Ingress, Instagram)A Web application (Web app) is an application program that is stored on a remote server and delivered over the Internet through a browser interface.(Designer Pages, Wistia,Wufoo)A hybrid application (hybrid app) is one that combines elements of both native and Web applications.(Facebook - Three20 as the core UI along with the Facebook SDK but HTML5 for feeds)

3

What is it?

Native App A native app is an app which is built for a specific platform using specific technologies like Xcode for iOS and Java for Android.Hybrid App A hybrid app is an app which uses native as well as web technologies to bring best of both worlds. Html5 App Html5 app is not installed on a phone. It runs on a browser and built using web technologies such that it is fully optimized for screen it runs on.

#

#Features ComparisonFeatureNativeHybridHTML5PerformanceFastControlledSlowMulti-touch/pinchYesYesNoDevice AccessAllAlmost allVery fewSecure storageYesYesShared/NoConnectivityOnline/OfflineOnline/OfflineMostly OnlineRolloutSlow/painfulSlow/painfulFastSecurityHighLowLowBest forGames/low contentMedium dynamic contentHigh dynamic contentToolsXcode, EclipsePhonegap, WorklightAny web basedDistributionDownloaded to device from AppStoreHosted on a Web server and accessed on a Web BrowserDownloaded to device from AppStoreIntegrationSupports integration with device features such as camera and address bookDoesnt support integration with device componentsSupports integration with device features such as camera and address bookNotificationsYesNoYes

#Market overviewFacebook moved away from HTML5 appsTwitter uses hybrid app approachA lot of ecommerce sites have HTML5 based mobile websitesLinkedIn also recently moved to native app

#HTML5 vs. Hybrid vs. Native

#Appium PhilosophyAppium was designed to meet mobile automation needs according to a philosophy outlined by the following four tenets:You shouldn't have to recompile your app or modify it in any way in order to automate it. you're testing the same app you're shippingYou shouldn't be locked into a specific language or framework to write and run your testsA mobile automation framework shouldn't reinvent the wheel when it comes to automation APIs. extended the JSON protocol with extra API methods useful for mobile automationA mobile automation framework should be open source, in spirit and practice as well as in name

#http://appium.io/introduction.html9

What is Appium ?Appium is an HTTP server that creates and handles WebDriver sessionsAppium starts a test case on the device that spawns a server and listens for proxied commandsOn Android, Appium proxies commands to a UiAutomator test case running on the deviceOn iOS Appium proxies commands to a UIAutomation script running in Instruments

#

Client/Server Architecture

Receives connections from a clientListens for commandsExecutes the commands on a mobile deviceResponds with an HTTP response representing the result of the command execution

Confidential and propriety Galil Software, Ltd. 2012 25.12.11

#

11

Selenium WebDriver Script (C#,Java,Perl,Python,PHP)

Server written in node.jsIDE

JSON WIRE Protocol via http

UIAutomator request via USB

UIAutomation request via USB

#

Appium Architecture

Confidential and propriety Galil Software, Ltd. 2012 25.12.11

#

13

Session

Session ObjectClients initiate a session with a server in ways specific to each libraryAll libraries end up sending a POST /session request to the server, with a JSON object called the 'desired capabilities' objectthe server will start up the automation session and respond with a session ID which is used for sending further commands

Confidential and propriety Galil Software, Ltd. 2012 25.12.11

#

JSONDesired capabilities tell the Appium server what kind of automation session we're interested in starting upThere are various capabilities which can modify the behavior of the server during automation (e.g. tell Appium that we want an iOS session, rather than an Android one)

Desired Capabilities

Confidential and propriety Galil Software, Ltd. 2012 25.12.11

#JavaScript Object Notation(JSON) isused to represent objects with complex data structures. It is used primarily to transfer data between a server and a client on the web. It has very much become an industry standard for various REST web services, playing a strong alternative to XML.A client can send a persons details to a server in the preceding JSON format, which the server can parse and create an instance of thePersonobject for use in its execution.Later, the response can be sent back by the server to the client in the JSON format, the data of which the client can use to create an object of a class.

15

AppiumServer

Appium ServerAppium is a server written in Node.js. It can be built and installed from source or installed directly from NPM

Confidential and propriety Galil Software, Ltd. 2012 25.12.11

#Npm: package manager that makes it easy for JavaScript developers to share and reuse code, and it makes it easy to update the code that you're sharing.Node.js:is anopen source,cross-platformruntime environmentfor server-side and networking applications. Node.js applications are written inJavaScript, and can be run within the Node.js runtime onOS X,Microsoft Windows,Linux,FreeBSD,NonStop,IBMAIX,IBM SystemzandIBMi. Its work is hosted and supported by the Node.js Foundation,[3]a Collaborative Project at Linux Foundation.

16

Appium Clients

There are client libraries (in Java, Ruby, Python, PHP, JavaScript, and C#) which support Appium's extensions to the WebDriver protocol. When using Appium, you want to use these client libraries instead of your regular WebDriver client.

Confidential and propriety Galil Software, Ltd. 2012 25.12.11

#

17

Appium on real iOS devicesAppium has support for real device testing.

To get started on a real device, you will need the following:

An Apple Developer ID and a valid Developer Account with a configured distribution certificate and provisioning profile.An iPad or iPhone. Make sure this has been set up for development in Xcode. See this article for more information.A signed .ipa file of your app, or the source code to build one.A Mac with Xcode and the Xcode Command Line Developer Tools.

Confidential and propriety Galil Software, Ltd. 2012 25.12.11

#Language ClientsGithub Repo and Installation InstructionsLanguage/Frameworkhttps://github.com/appium/ruby_libRubyhttps://github.com/appium/python-clientPythonhttps://github.com/appium/java-clientJavahttps://github.com/admc/wdJavaScript (Node.js)https://github.com/appium/selenium-objective-cObjective Chttps://github.com/appium/php-clientPHPhttps://github.com/appium/appium-dotnet-driverC# (.NET)http://github.com/appium/perl-clientPerl https://github.com/jollychang/robotframework-appiumlibraryRobotFramework

#http://appium.readthedocs.org/en/stable/en/about-appium/appium-clients/

19

Appium GUI

Confidential and propriety Galil Software, Ltd. 2012 25.12.11

#

20

RequirementsIOSMac OSX 10.7XCode 4.5Command Line Tools

AndroidMac OSX 10.7 or Windows 7 or LinuxAndroid SDK

FirefoxFirefox OS Simulator

Confidential and propriety Galil Software, Ltd. 2012 25.12.11

#Supported Platforms

IOSAndroid FirefoxOS

Is it True ?!

#

22

Smile 1

Confidential and propriety Galil Software, Ltd. 2012 25.12.11

#IOSVersions: 6.0, 6.1, 7.0, 7.1, 8.0, and 8.1Devices: iPhone Simulator, iPad Simulator, and real iPhones and iPadsNative app support: YesMobile web support: Yes, via automation of mobile Safari.Hybrid support: Yes.Support for automating multiple apps in one session: NoSupport for automating multiple devices simultaneously: No

#AndroidVersions: 2.3 and upDevices: Android emulators and real Android devicesNative app support: YesMobile web support: YesHybrid support: YesSupport for automating multiple apps in one session: YesSupport for automating multiple devices simultaneously: Yes

#

Appium is a server written in Node.js. It can be built and installed from source or installed directly from NPM

#http://www.3pillarglobal.com/insights/appium-a-http://testautomation.applitools.com/post/102167915707/free-on-demand-best-step-by-step-appium-webinarcross-browser-mobile-automation-tool26

SauceLabsAutomated testing in the cloud for CI.Provides the worlds largest cross-browser grid for executing Selenium & Appium WebDriver tests

#https://docs.saucelabs.com/tutorials/appium/27

SauceLabs Username & Access Key

#SauceLabs - Setuppublic class AppiumDriverTest {

private AppiumDriver driver;

@Parameters({"username", "key", "os", "browser", "