public class Conatcmanagertestcase {
WebDriver driver;
@Test
public void testApp() throws MalformedURLException,InterruptedException{
File app=new File("D:\\testingking\\DecJAVABatchVivek\\Appium_pratice\\src\\test\\resources\\apk\\Drag Sort Demos_v0.5.0_apkpure.com.apk");
DesiredCapabilities caps= new DesiredCapabilities();
caps.setCapability("deviceName","Galaxy J7 Prime");
caps.setCapability("platformName","Android");
//caps.setCapability(MobileCapabilityType.APP_PACKAGE, "com.whatsapp");
caps.setCapability("app", app.getAbsolutePath());
// caps.setCapability("appPackage", "com.whatsapp");
// caps.setCapability("appActivity", "com.whatsapp.Main");
driver = new AndroidDriver<MobileElement>(new URL ("http://127.0.0.1:4723/wd/hub"),caps); //127.0.0.1:4723
driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);// implicit or global wait
Thread.sleep(3000);
}}
Instructor
aditya Replied on 27/12/2018Use mobile driver and udid concept and follow latest videos