For Video Tutorial : Move on Youtube Channel
Note : Select the playlist as per your need & move with number sequence
Hello Friends,
In this session, we will discuss that how to automate Andriod "Native" application Like Dialer.
For Video :- Click Here
Here is the Sample code :
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;
public class Nativeapp
{
public static AndroidDriver
public static void main(String[] args) throws MalformedURLException
{
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", "com.android.dialer");
capabilities.setCapability("appActivity", "com.android.dialer.DialtactsActivity");
driver = new AndroidDriver
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.findElement(By.id("Call Csc Idea")).click();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.quit();
}
}
After that you must set the capability for app package and app activity.
How to find app package & app activity
Now you have to locate your number/contact to make a call
Now run the code & verify that you application is launched.
Tags :
How to automate Andriod Dialer | Code to automate andriod Native application |
Appium tutorial to automate Calling Number | Appium tutorial to automate already installed app |
No comments:
Post a Comment