APPIUM



What is Appium?

APPIUM is an open source mobile application UI testing framework that is freely available. Appium provides automation testing on both physical devices and emulators or simulators and allows native, hybrid, and web application testing. It supports cross-platform application testing, which means that a single API may be used to run test scripts on both Android and iOS platforms.

It is not reliant on the operating system of mobile devices. Because APPIUM provides a framework or wrapper that converts Selenium Webdriver commands into UIAutomation (iOS) or UIAutomator (Android) commands based on device type, rather than OS type.

  • Java, Objective-C, JavaScript with node.js, PHP, Ruby, Python, C#, and other languages having Selenium client libraries are all supported by Appium.

    We will learn about in this lesson.

    How APPIUM Works?
  • Prerequisite to use APPIUM
  • Install Appium Desktop:
  • APPIUM Inspector
  • Attach Android Emulator to Appium

Common Encountered Errors and Troubleshooting Steps in Appium

How APPIUM Works?

  • Appium is a Node.js-based 'HTTP Server' that uses the Webdriver JSON wire protocol to drive iOS and Android sessions. As a result, Node.js must be installed on the machine before the Appium Server can be started.
  • When we download and install Appium, it creates a server on our PC that exposes a REST API.
  • It receives the client's connection and command requests and performs them on mobile devices (Android / iOS).
  • It answers to HTTP requests with HTTP responses. Again, the mobile test automation frameworks are used to drive the user interface of the apps in order to carry out this request. Apple Instruments for iOS is an example of a framework (Instruments are available only in Xcode 3.0 or later with OS X v10.5 and later)
  • Android UIAutomator by Google API level 16 and up

1.      Selendroid requires an Android API level of 15 or lower.

Prerequisite to use APPIUM
Install ANDROID SDK (Studio)

2.      Install JDK (Java Development Kit)

3.      Install Eclipse

4.      Install TestNg for Eclipse

5.      Install Selenium Server JAR

6.      Appium Client Library

7.      APK App Info on Google Play

js (Not Required – Whenever Appium server is installed, it by default comes with “Node.exe” & NPM. It’s included in Current version of Appium.)

Install Appium Desktop:

Appium Studio is a GUI software for installing Appium Server that is open source. It includes all of the prerequisites for installing and using Appium Server. It also features an Inspector feature that allows you to get basic information about your apps. It includes a Recorder that allows you to generate boilerplate code for automating your mobile apps.

Step 1:
 Go to http://appium.io/ and select Download Appium from the drop-down menu.

APPIUM Tutorial For Beginners
Step 2)
 Select the exe file for Windows and download it. The file is approximately 162MB in size and will take some time to download depending on your internet speed.

Step 3)
Double-click the exe file you just downloaded.

APPIUM Tutorial For Beginners

Step 4)
There is no need to install Appium on a Windows PC. It executes directly from the executable. For a few minutes after clicking the exe, you will see the image below.
To use the APPIUM Tutorial For Beginners on a Mac, you must first download and install the dmg file.

APPIUM Tutorial For Beginners

Step 5)
The Server Start Window will appear next. It fills in the default host and port settings, which you can modify. It also specifies the Appium version that isbeing used.

APPIUM Tutorial For Beginners

Step 6)
Pressing the Start Server Button starts a new server on the given host and port.
APPIUM Tutorial For Beginners

|Step 7)
Select New Session Window from the drop-down menu.
APPIUM Tutorial For Beginners

Step 8)

Now you may start a session by entering the Desired Capabilities.
APPIUM Tutorial For Beginners


APPIUM Inspector
Appium has a 'Inspector' to record and playback, similar to Selenium IDE's record and playback function. It inspects the DOM to record and play native application behaviour and provides test scripts in any preferred language. However, Appium Inspector does not presently support Microsoft Windows. It launches the Appium Server on Windows but fails to inspect components. TheUIAutomator viewer, on the other hand, can be used to inspect elements.

To get started with Appium Inspector on a Mac, follow these steps:-

Step 1:
 Download and launch your Appium server using the default IP address of 0.0.0.0 and port 4725.

 

To test, select the source file or.app files from your local drive.

To activate the 'Choose' button, check the 'App Path' Checkbox.

Step 2)
 Clicking the 'Choose' button now allows you to browse and select a test file from your local drive.
APPIUM Tutorial For Beginners

Step 3)
 Launch Simulator on your Mac.

Step 4)
 In the upper right corner, click the 'Launch' button, which activates a blue colour symbol. When you click this blue colour icon again, the Appium inspector and Simulator will appear with a pre-selected application.
APPIUM Tutorial For Beginners

Step 5)–
 When you open your Appium Inspector, the element hierarchy will be displayed in a column-by-column format. A user can also do actions via tapping, swiping, and so on.

APPIUM Tutorial For Beginners

Step 6)
Click on ‘Stop’ button to stop recording.

Attach Android Emulator to Appium

Step 1)
 Install Android SDK in your system.

Go to Control panel >> System and Security >> System and from the left panel click on ‘Advanced System Settings’. From ‘System Properties’ pop up, click on ‘Advanced’ tab and then click on “Environment Variables” button.

APPIUM Tutorial For Beginners

Step 2
Double-click on 'Path' in the 'Environment variables' pop-up and set ANDROID HOME to point to your SDK location. Add the entire SDK folder path to the path.
APPIUM Tutorial For Beginners

Step 3)
 Start your Android emulator or connect any Android device to your computer (make sure your Android device has the Android Debugging option enabled). To see if the Debugging Option is enabled. Check "Debugging Option" in Device Settings >> Developer Options).

Step 4)
 Open Command Prompt and go to the platform-tools directory in your Android SDK (for example, D:adt-bundle-windows-x86 64-20130514sdkplatform-tools).

Step 5)
 Run ‘adb devices’ command. You can see your connected device listed in Command Prompt window. (In CMD write ‘>adb devices’- This command will list the connected emulator instances. E.g.: adb –s emulator-5554 install <Location of .apk file>)

Comments