As we all know that the espresso is specially designed for Android devices and it is much faster than others. Have you ever thought of integrating Espresso Test within the Appium itself to boost the Read More
Categories : Appium
Posted by Shibu Panda
No Comments
Simply use this method. Provide your package name as an argument and it will give you “true” if the application is already installed else “false”. (only applicable on pCloudy) Code Snippet: private boolean isMyAppInstalled(String packageName) Read More
Categories : Appium
Posted by Anshuman Chatterjee
No Comments
Code Snippet: //Appium Version: 1.12.0 //Java-Client:7.0.0 MobileElement webElement=driver.findElement(By.xpath("//android.widget.RelativeLayout[@resource-id='com.fortysevendeg.android.swipelistview:id/front']")); LongPressOptions longPressOptions = new LongPressOptions(); longPressOptions.withDuration(Duration.ofSeconds(4)).withElement(ElementOption.element(webElement)); new TouchAction(driver).longPress(longPressOptions).perform(); Read More
Categories : Appium
Posted by Shibu Panda
No Comments
Code Snippet: Object obj = driver.executeScript("pCloudy_executeAdbCommand", "adb devices"); System.out.println("@Output: " + obj); Read More
Categories : Appium
Posted by Shibu Panda
No Comments
Code Snippet: capabilities.setCapability("unlockKey", "pin"); *** it will work for device version 6 and above Read More
Categories : Appium
Posted by Sridatta Pani
No Comments
Code Snippet: //str ===> Which text contains by the element driver.findElementsByAndroidUIAutomator("newUiScrollable(newUiSelector().scrollable(true).instance(0)).scrollIntoView(newUiSelector().textContains(\"" + str +"\").instance(0))"); Read More
Categories : Appium
Posted by Shibu Panda
No Comments
Code Snippet: TouchAction touch = new TouchAction(driver); touch.press(driver.findElement(By.id("elementID on top"))).waitAction(Duration.ofMillis(2000)).moveTo(driver.findElement(By.id("ElementId on bottom"))).release().perform(); Read More
Categories : Appium
Posted by Shibu Panda
No Comments
Code Snippet: //Here we have Initialized driver as AppiumDriver driver.findElement(By.id("doc.saulmm.notification:id/simple_notification")).click(); ((AndroidDriver) driver).openNotifications(); ListnotificationTitles = driver.findElements(By.id("android:id/title")); for (WebElement title: notificationTitles) { String extractTitle = title.getText(); if (extractTitle.contains("I'm a simple notification")) { driver.findElement(By.id("com.android.systemui:id/clear_notification")).click(); } } *** Users Read More
Categories : Appium
Posted by Shibu Panda
No Comments
Code Snippet: capabilities.setCapability("autoGrantPermissions",true) Read More
Categories : Appium
Posted by Shibu Panda
No Comments
Code Snippet: Set contextNames = driver.getContextHandles(); driver.context(); ***Yes, WebView.setWebContentsDebuggingEnabled(true); is needed for webviews to work through UI Automator. This is an Android requirement, not Appium. Read More
Categories : Appium
Posted by Shibu Panda
No Comments