Suyati Technologies
  • Platforms
    • CRM
      • Salesforce
      • Dynamics
    • CMS
      • Sitecore
      • Drupal
      • Episerver
      • Sitefinity
    • Ecom
      • Magento
      • Sitecore commerce
    • RPA
      • UiPath
    • Analytics
    • Martech
  • Services
    • CX Consulting
    • DSaaS
    • Product Engineering
  • Fluid Solutions
    • Buyer Rhythms Engine
    • Lead Prioritization
    • Customer LifeTime Value
    • Chatbot
    • Account Based Marketing
    • Online Proctoring Solution
  • Intel
    • Blog
    • eBooks
    • Webinars
    • Case Studies
  • About Us
    • Management Team
    • Advisory Board
    • Our Story
    • Testimonials
  • Careers
Suyati Technologies
  • Platforms
    • CRM
      • Salesforce
      • Dynamics
    • CMS
      • Sitecore
      • Drupal
      • Episerver
      • Sitefinity
    • Ecom
      • Magento
      • Sitecore commerce
    • RPA
      • UiPath
    • Analytics
    • Martech
  • Services
    • CX Consulting
    • DSaaS
    • Product Engineering
  • Fluid Solutions
    • Buyer Rhythms Engine
    • Lead Prioritization
    • Customer LifeTime Value
    • Chatbot
    • Account Based Marketing
    • Online Proctoring Solution
  • Intel
    • Blog
    • eBooks
    • Webinars
    • Case Studies
  • About Us
    • Management Team
    • Advisory Board
    • Our Story
    • Testimonials
  • Careers
Suyati Technologies > Blog > Quick tips to perform mobile automation using Appium

Quick tips to perform mobile automation using Appium

by Sarath Viswanath February 27, 2017
by Sarath Viswanath February 27, 2017 0 comment

mobile automation using Appium

Appium is an open source, cross-platform mobile test automation tool for native and hybrid applications. Tests can be done on simulators, emulators and on real devices too. It is an extension of Selenium webdriver. Appium has its own unique features. It supports IOS, Android and FirefoxOS.

Why is Appium in demand?

If we are using Appium for our mobile app automation, we can write the code in any language supported by Selenium webdriver. Also, we can use any testing framework which matches our goals. If we want to automate IOS apps, we need to use Apple’s UI Automation library. Similarly, to automate Android apps we need to use Google’s UI Automator library, which supports only Java.

Appium Architecture

1

Appium follows Client- Server Architecture. The language in which we write the script is called client libraries. Once we write the code and run it, the command reaches the Appium server which is written in Node js.  Appium server should be started before executing the program, if not, an error will be thrown. The commands will be reaching the server as session objects. The server will understand the commands, and triggers the invocation into the mobile device.

Appium act as a bridge between the client library (where actually we write the code) and the mobile device. It has the ability to identify whether it is IOS or Android framework. This is achieved through a mechanism called Desired Capabilities. It takes our input and passes it to the Appium server to create a session. Input includes Platform name (IOS/Android), Device name (Emulator/Real device) and Path of the application under test.

 

Prerequisites for Android Automation

  • Install Java and set the path

http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html

  • Install Android Studio and set the path

https://developer.android.com/studio/index.html

  • Install Eclipse IDE

http://www.eclipse.org/downloads/packages/eclipse-ide-java-and-dsl-developers/neon2

  • Download and install Appium server

https://appium.io/downloads.html

  • Download Selenium and Appium Jar files

http://selenium-release.storage.googleapis.com/index.html?path=2.51/

https://mvnrepository.com/artifact/io.appium/java-client/2.1.0

  • Create a Project in Eclipse

Open Eclipse-> Click on file-> new-> Java Project-> Enter project name-> Finish

2

3

  • Import Selenium and Appium Jar files to the project

Right click on the Project-> Build path-> Configure build path-> Add external Jars-> Apply

4

5

Getting started with an Appium Program

Once we are done with the prerequisites, we can move to developing scripts. Every Appium code should begin with desired capabilities. To provide inputs to the server first we need to create an object of class “DesiredCapabilities”. And with that object we can pass other commands also. These commands will be common for all Android apps except the path of the application under test. Given below is a sample code which will be common to all apps written in Java.

@Test (Default annotation in TestNG Framework)

Step 1: DesiredCapabilities cap=new DesiredCapabilities();

 //Creating Object “cap” for class “DesiredCapabilities”

Step 2: cap.setCapability(MobileCapabilityType.PLATFORM_NAME,MobilePlatform.ANDROID);

//Passing command with the cap object to server that the platform we are using is Android

Step3: cap.setCapability(MobileCapabilityType.DEVICE_NAME, “Android Emulator”);

//Command telling the server that the device we are going to use is emulator

Step4: File appDir = new File (“folder name”);

        File app = new File (appDir, “sample.apk”);

// These 2 steps define the path of the app      

Step 5:  cap.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());

// Passing the app path to the server

Step6: AndroidDriver driver=new AndroidDriver (newURL (“http://127.0.0.1:4723/wd/hub”),cap );

//Invoking Android driver and we are passing the command to Appium server which is configured in port number 4723

 

Related Posts:

  • Benefits of using Selenium for Test Automation in enterprises
  • Tips to select the right mobile testing tool
  • Software Testing Trends That Dominated 2016

About the Author:

Sarath Viswanath

Sarath-photo

Sarath is currently working as QA Engineer at Suyati Technologies. A great tech enthusiast, Sarath is keenly interested in Automation testing for both mobile and web applications. He is a novice in the blogging arena and also loves playing cricket.

0 comment
0
FacebookTwitterLinkedinTumblr
previous post
10 ecommerce solutions for your Drupal website
next post
Public Cloud Services to grow 18% in 2017

You may also like

Leverage AI to Take your Business to the...

May 17, 2022

Global Capability Centers enable accelerated adoption of technology

May 9, 2022

Best Practices to Get Salesforce Implementation Right the...

April 21, 2022

How to manage legacy systems (Upgrade, Replace, Rebuild)?

April 20, 2022

Tackle Duplication Challenges in Salesforce Effectively

March 24, 2022

What are the Key Takeaways of Salesforce DevOps...

March 22, 2022

Derive Greater Value through Better Hybrid Cloud Management

March 15, 2022

How DevOps can Help Salesforce Develop and Deploy...

March 7, 2022

Six trends that Salesforce has for your enterprise...

February 22, 2022

Harnessing the Power of Cloud Continuum for Your...

February 22, 2022

Leave a Comment Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

Keep in touch

Twitter Linkedin Facebook Pinterest

Recent Posts

  • Leverage AI to Take your Business to the Next Level

    May 17, 2022
  • Global Capability Centers enable accelerated adoption of technology

    May 9, 2022
  • Best Practices to Get Salesforce Implementation Right the Very First Time

    April 21, 2022

Categories

  • Twitter
  • Linkedin
  • Facebook
  • Instagram
  • Platforms
    • CRM
      • Salesforce
      • Dynamics
    • CMS
      • Sitecore
      • Drupal
      • Episerver
      • Sitefinity
    • Ecom
      • Magento
      • Sitecore commerce
    • RPA
      • UiPath
    • Analytics
    • Martech
  • Services
    • CX Consulting
    • DSaaS
    • Product Engineering
  • Fluid Solutions
    • Buyer Rhythms Engine
    • Lead Prioritization
    • Customer LifeTime Value
    • Chatbot
    • Account Based Marketing
    • Online Proctoring Solution
  • Intel
    • Blog
    • eBooks
    • Webinars
    • Case Studies
  • About Us
    • Management Team
    • Advisory Board
    • Our Story
    • Testimonials
  • Careers

© 2022 Suyati Technologies


Back To Top
Suyati Technologies

Popular Posts

  • MongoDB vs. Couchbase

    May 26, 2013
  • 2

    What is Salesforce CRM and What Does it Do?

    February 19, 2014
  • 3

    A step-by-step guide to configuring emails in MS Dynamics CRM

    April 27, 2017
  • 4

    Top 10 ETL Tools for Salesforce Data Migration 2021

    January 4, 2021
  • 5

    What are the Top 3 risks for implementing a CX Program?

    August 30, 2019
© 2022 Suyati Technologies

Read alsox

5 Tips to Future Proof Your Resource Pipeline

January 28, 2021

The Top 10 Wish-list for iOS9

May 7, 2015

The Challenges of Delivering Personalized Quotes in Insurance

November 29, 2019
Suyati Logo

Leaving So Soon?

Know more about business technology platforms for your enterprise.

Thank you!

We're glad to have you as part of our community. You'll start receiving updates shortly. Please feel free to contact us anytime with feedback or suggestions.

By continuing to use this website you agree with our use of cookies. Read More Agree