APPIUM

APPIUM
Written by Seema SamalSeptember 5, 2020
4 min read
Software
24 VIEWS 3 LIKES 1 DISLIKES SHARE
3 LIKES 1 DISLIKES 24 VIEWS SHARE
Seema Samal

Software ENGINER

Appium is a tool used for Mobile Automation.

What is Appium:-

So Appium is a tool or software that is used basically for mobile Automation. Anyone who belong to Automation Testing might have heard the word Appium. It is very easy to use . Let's take a short look on download , setup and it's use.

Download:-

Before download appium we have some pre-requisite, because we are using for Java we have following requirements

1.jdk i.8 and above

2.node js

3.uiautomatorviewer

So we can download Appium from command prompt by command :- npm install -g appium(both linux and windows)

From site - http://appium.io/downloads.html

-After getting appium installed. We'll move to setup.

Setup:- To setup ,we need a mobile and the application which you want to automate.

Step1:-Enable Developer Option and enable Debugging mode on mobile.

Step2:-Make your phone on file transfer mode.

When you connect mobile on system an adb debugging pop up should be appear ,if not check for usb driver installed on system according mobile model.

Step3:-Hit adb devices command from cmd ,you can see the connected devices.

step4:-Hit uiautomatorviewer commad again in cmd then uiautomatorviewer tool will open to get the locator.

Use By using JAVA:-

Start appium server by command 'appium' , It will run on localhost with default port 4723.

Here is sample test of Appium integrated with JAVA code

package wikiance.src_Appium;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;



public class Wikiance {
WebDriver driver;
//main method
public static void main(String args[]){
//calling setUp method
      setUp();
//calling testBlog method
      testBlog()
//calling testClose method
      testClose()
}

public static void setUp() throws MalformedURLException{
//Set up desired capabilities and pass the Android app-activity and app-package to Appium
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("BROWSER_NAME", "Android");
capabilities.setCapability("VERSION", "10.0");
capabilities.setCapability("deviceName","SM-A7");
capabilities.setCapability("platformName","Android");


capabilities.setCapability("appPackage", "com.");
// This package name of your app (you can get it from apk info app)
capabilities.setCapability("appActivity","com.wikiancemobile.MainActivity"); // This is Launcher activity of your app (you can get it from apk info app)

//It will launch the Calculator App in Android Device using the configurations specified in Desired Capabilities
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}

public static void testBlog() throws Exception {
//locate the Text on the calculator by using By.name()
WebElement ele1 =driver.findElement(By.xpath("xpath here"));
ele1.click();

//Like this we can do the need full

}
public static void testClose(){
//close the app
driver.quit();
}
}
Download
Setup
Use
24 VIEWS 3 LIKES 1 DISLIKES SHARE
3 LIKES 1 DISLIKES 24 VIEWS SHARE
Was this blog helpful?
You must be Logged in to comment
Code Block
Seema Samal
Software ENGINER
1 Blog Posts
0 Discussion Threads
Trending Categories
93
Software12
DevOps34
Frontend Development13
Backend Development13
Server Administration13
Linux Administration12
Data Center14
Sentry11
Terraform15
Ansible9
Docker13
Penetration Testing12
Kubernetes12
NGINX8
JenkinsX10
Jenkins18
SSL6
Ethical-Hacking10
Python8
NodeJs9
RedHat8
Github11
AngularJs15
Google Cloud Platform (GCP)6
SonarQube9
Amazon Web Service (AWS)2
VMware17
Blockchain6
Snipe-IT7