public void printSafaraConsoleLog(AppiumDriver driver) { if (driver != null) { for (LogEntry entry : driver.manage().logs().get("safariConsole")) { HashMap consoleEntry = new Json().toType(entry.getMessage(), Json.MAP_TYPE); System.out.println(String.format("%s [%s] %s", entry.getTimestamp(), entry.getLevel(), consoleEntry.get("text"))); } } } Read More
Categories : Appium
Posted by Ahmad Sayeed
No Comments
"1. Using Refresh command- driver.navigate().refresh(); 2. Using get command- driver.get(""https://www.google.com.bd/""); //Or the page URL. 3. Using the current url- driver.navigate().to(driver.getCurrentUrl());" Read More
Categories : Appium
Posted by Shah Nawaz
No Comments
driver.hideKeyboard(); Read More
Categories : Appium
Posted by Shah Nawaz
No Comments
Code Snippet: //Java-Client version: Latest(7.0.0) //Appium version: 1.9.1 AndroidTouchAction firstFinger= new AndroidTouchAction(driver); firstFinger.press(PointOption.point(xOffset, yOffset-200)).moveTo(PointOption.point(xOffset, yOffset-20)); AndroidTouchAction secondFnger= new AndroidTouchAction(driver); secondFnger.press(PointOption.point(xOffset, yOffset+200)).moveTo(PointOption.point(xOffset, yOffset+20)); MultiTouchAction action2= new MultiTouchAction(driver); action2.add(firstFinger).add(secondFnger).perform(); Thread.sleep(10000); Read More
Categories : Appium
Posted by Shibu Panda
No Comments
Code Snippet: //Java-Client version: Latest(7.0.0) //Appium version: 1.9.1 AndroidTouchAction firstFinger= new AndroidTouchAction(driver); firstFinger.press(PointOption.point(xOffset, yOffset-20)).moveTo(PointOption.point(xOffset, yOffset-200)); AndroidTouchAction secondFnger= new AndroidTouchAction(driver); secondFnger.press(PointOption.point(xOffset, yOffset+20)).moveTo(PointOption.point(xOffset, yOffset+200)); MultiTouchAction action= new MultiTouchAction(driver); action.add(firstFinger).add(secondFnger).perform(); Thread.sleep(10000); Read More
Categories : Appium
Posted by Anshuman Chatterjee
No Comments
Code Snippet: //Java-Client version: Latest(7.0.0) //Appium version: 1.9.1 MobileElement imageElement=(MobileElement) driver.findElementById("com.davemorrissey.labs.subscaleview.sample:id/imageView"); AndroidTouchAction touch = new AndroidTouchAction(driver); touch.press(PointOption.point(150, 200)).release().perform().waitAction(WaitOptions.waitOptions(Duration.ofMillis(50))).press(PointOption.point(100, 300)).release().perform(); Read More
Categories : Appium
Posted by Sridatta Pani
No Comments
Code Snippet: //Java-Client version: Latest(7.0.0) //Appium version: 1.9.1 driver.findElement(By.xpath("//android.widget.TextView[@resource-id='com.mobeta.android.demodslv:id/activity_desc']")).click(); MobileElement dragElement = (MobileElement) driver.findElementsById("com.mobeta.android.demodslv:id/drag_handle").get(2); MobileElement dropElement = (MobileElement) driver.findElementsById("com.mobeta.android.demodslv:id/drag_handle").get(5); //Created object of TouchAction class. AndroidTouchAction finger1= new AndroidTouchAction(driver); int xCoordinate = dragElement.getLocation().getX(); int yCoordinate = Read More
Categories : Appium
Posted by Shibu Panda
No Comments
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