How to perform multiple touch on any device?

Code Snippet: TouchAction fingerOne = new TouchAction(driver); TouchAction fingerTwo = new TouchAction(driver); MultiTouchAction action = new MultiTouchAction(driver); fingerOne.press(20, 20); fingerOne.moveTo(10, 100); fingerOne.release(); fingerTwo.press(30, 30); fingerTwo.moveTo(20, 200); fingerTwo.release(); action.add(fingerOne); action.add(fingerTwo); action.perform();

How to perform pinch out operation in android device using appium?

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);

How to perform Drag and Drop operation in android device using appium?

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 …

How to perfrom Long press operation in Andriod devices?

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();

How to scroll down to a particular element having text?

Code Snippet: //str ===> Which text contains by the element driver.findElementsByAndroidUIAutomator(“newUiScrollable(newUiSelector().scrollable(true).instance(0)).scrollIntoView(newUiSelector().textContains(\”” + str +”\”).instance(0))”);

How to automate pull down refresh functionality?

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();

How to handle push notification?

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”)) { …