APPIUM

APPIUM
Techiio-author
Written by Seema SamalSeptember 5, 2020
4 min read
Software
31 VIEWS 4 LIKES 1 DISLIKES SHARE
4 LIKES 1 DISLIKES 31 VIEWS SHARE
Techiio-author
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
31 VIEWS 4 LIKES 1 DISLIKES SHARE
4 LIKES 1 DISLIKES 31 VIEWS SHARE
Was this blog helpful?
techiio-price-plantechiio-price-plantechiio-price-plantechiio-price-plantechiio-price-plan
You must be Logged in to comment
Code Block
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance