Home Java Overview Maven Tutorials

Wednesday, 5 July 2017

Data Driven Framework in Appium for android

For Video Tutorial : Move on Youtube Channel

Note : Select the playlist as per your need & move with number sequence

Data Driven Framework in Appium:

For Video : CLICK HERE For Part1

Hello Friends,
In this tutorial we will discuss how to create Data Driven Framework in appium for Android.

It is very similar as we created in Selenium for any web application.

Click Here

for selenium data driven framework.

Suppose we have below scenarios/Task to automate on Android to add multiple contacts in android :-

Our Scenarios will be as below :
1).Open Android dialer
2).Click on contacts
3).Click on create contacts
4).Enter Name
5).Enter Mobile Number
6).Click save button
7).Click on home Button

We will write the code in eclipse to achieve the objective.

import java.util.List;
import java.util.concurrent.TimeUnit;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.openqa.selenium.By;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import io.appium.java_client.remote.MobileCapabilityType;
public class Newtest2
static AndroidDriver driver;
XSSFWorkbook wb;
static XSSFSheet sheet;
FileInputStream fis;
public void g() throws IOException
File src = new File("D:\\study material\\Selenium Final complete\\Appium software\\contactsdata\\contact_data.xlsx");
fis = new FileInputStream(src);
wb = new XSSFWorkbook(fis);
sheet = wb.getSheetAt(0);
public void main() throws MalformedURLException, InterruptedException
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "LYF");
capabilities.setCapability(MobileCapabilityType.VERSION, "6.0.1");
capabilities.setCapability(MobileCapabilityType.PLATFORM, Platform.ANDROID);
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Andriod");
capabilities.setCapability("appPackage", "");
capabilities.setCapability("appActivity", "");
File file = new File("C:\\Users\\cchauhan\\Downloads\\New Appium\\src\\apk file\\.apk");
capabilities.setCapability("apk", file.getAbsolutePath());
driver = new AndroidDriver(new URL(""), capabilities);
for(int i =121 ; i<131; i++)
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.findElement("Create new contact")).click();
List list = driver.findElementsByClassName("android.widget.EditText");
String data = sheet.getRow(i).getCell(0).getStringCellValue();
//WebElement Name = driver.findElement("Name"));
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
DataFormatter formatter = new DataFormatter();
String val = formatter.formatCellValue(sheet.getRow(i).getCell(1));
//WebElement number = driver.findElement("Phone"));
driver.manage().timeouts().implicitlyWait(7, TimeUnit.SECONDS);
List list2 = driver.findElements(By.className("android.widget.TextView"));

Tags :-

Data driven framework in appium,

How to create data driven framework in appium

Code for data driven framework in appium,

Example of data driven framework in appium


  1. Replies
    1. Great Article
      android based projects

      Java Training in Chennai

      Project Center in Chennai

      Java Training in Chennai

      projects for cse

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

  2. The development of artificial intelligence (AI) has propelled more programming architects, information scientists, and different experts to investigate the plausibility of a vocation in machine learning. Notwithstanding, a few newcomers will in general spotlight a lot on hypothesis and insufficient on commonsense application. Machine Learning Final Year Projects In case you will succeed, you have to begin building machine learning projects in the near future.

    Projects assist you with improving your applied ML skills rapidly while allowing you to investigate an intriguing point. Furthermore, you can include projects into your portfolio, making it simpler to get a vocation, discover cool profession openings, and Final Year Project Centers in Chennai even arrange a more significant compensation.

    Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account.