Appium is an open source test automation tool developed and supported by Sauce Labs to automate native and hybrid mobile apps. It is basically know as a Cross browser Mobile Automation Tool. It uses JSON wire protocol internally to interact with iOS and Android native apps using theSelenium WebDriver.
Appium is a HTTP server written in node.js which creates and handles multiple WebDriver sessions for different platforms like iOS and Android. Appium starts a “test case” on the device that spawns a server and listens for proxies commands from the main Appium server. It is almost same asSelenium server which perceives HTTP requests from selenium client libraries and it handles those requests in different ways depending upon the platforms. Each vendor like iOS and Android have a different way and mechanism to run a test case on the device so Appium kind of hacks in to it and run this testcase after listening commands from Appium server.
How Appium works in iOS?
In the above figure, we can see the architecture of the Appium in context to the iOS automation. If we talk about a command lifecycle, it goes like,Selenium webdriver picks a command form the code like (Element.click) and sends it in form of JSon via http request to the Appium server. Appium server knows the automation context like the iOS and Android and sends this command to the Instruments command server which will wait for the Instruments command client (written in node.js) to pick it up and execute it in bootstrap.js with in the iOS instruments environment. Once the command is executed the command client sends back the message to the Appium server which logs everything related to the command in its console. This cycle keeps going till the time all the commands gets executed.
How Appium works in Android?
The situation is almost similar in case of Android where Appium proxies commands to a UIAutomator test case running on the device. UIAutomatoris Android’s native UI automation framework which supports running junit test cases directly in to the device from the command line.It uses java as a programming language but Appium will make it run from any of the WebDriver supported languages.
In the above diagram we can see, here we have Bootstrap.jar in place of bootstrap.js which represents out test case when compiled in java. As soon as it gets launched it spawns a TCP server. Here the TCP server resides inside the device and client is in the Appium process which is just opposite to the way it is in iOS.
Before executing mobile scripts in MTAF, These are the prerequisite that user has to install in local system / remote. Basically here we are setting up appium server. Install the Java Development Kit (JDK) Set Up Java Environment Variable Path
Install Android SDK / ADB on Windows Set up Android Environment Variable Download and Install NodeJs Install Microsoft .net Framework Download And Install Appium Desktop Client Enabling Developer Mode Options on Android Phone or Tablet Install PdaNet to Connect with Android Device
Install the Java Development Kit (JDK)
How to Install the Java Software Development Kit (JDK)
1) First of all you need to install JDK (Java development kit) in your system. The Java Software Development Kit (Java SDK or JDK) is an application created by Sun Microsystems to create and modify Java programs. So your next question will be “How to download Java or JDK”. Click here to download Java and install Java Development Kit (JDK) in your system as per given installation guide over there or follow the below mentioned steps. 1) Visit the Java downloads page on Oracle’s website to find the JDK environment download. Scroll down until you find Java SE Latest Version and download JDK.
Note: On 4th June’15, latest version of Java is (JDK) 8u45. This JDK version comes bundled with Java Runtime Environment (JRE) so you do not need to download and install the JRE separately.
2) Select the radio button to “Accept License Agreement” and choose the JDK that corresponds to your OS (Operation System Windows, Mac, Linux, etc.)
3) The File Download dialog box appears prompting you to Save the download file.
4) Once the downloading is complete, double click the file to begin the installation of JDK.
5) To run the installer, click Run.
6) The installation process starts. Click the Next button to continue the installation.
7) On the next screen you will encounter some options. Just leave these alone and click Next unless you know what you are doing
8) After the initial installation is done, a pop up asking you where your source java files will be. You can choose to change where you want to keep your folder but it’s best to stick with what you were given first. Click Next to continue.
Note: Make a note of this location, as this location of JDK installation will be required to Set up Java Environment Variable in the next chapter.
9) Let the installation finish.
10) A few brief dialogs confirm the last steps of the installation process; click Close on the last dialog. This will complete Java installation process.
1/27/2017 Appium Automation Portal Functional Test Confluence
Path variable setup next: