Specific port for Chrome driver

Code: caps.setCapability(“chromedriverPort”, 4437); Specify a specific port for Chromedriver to accept connections on. With multiple webviews you may run into issues with ports being reused. In this case, use the …

Event timings

Code: caps.setCapability(“eventTimings”, true) Enable or disable Appium’s ability to report timing data for various internal events (e.g., the start and end of each command). To enable, set to true. The …

How to Swipe Right on the Element?

public void swipeRightOnElement(WebElement element) { Point point = element.getLocation(); Dimension eleSize = element.getSize(); int centerX = point.getX() + (eleSize.getWidth() / 2); int centerY = point.getY() + (eleSize.getHeight() / 2); int …

How to skip the Android device initialisation in Appium?

capabilities.setCapabilities(“skipDeviceInitialization”,true); Skip device initialization on Android. This includes installation and running of the Settings app, and permission setting. Can be used to improve startup performance when the device was previously …

How to set the data path in Appium?

capability.setCapability(“derivedDataPath”,”path”); Use along with “usePrebuiltWDA” capability and choose where to search for the existing WDA app. If the capability is not set then Xcode will store the derived data in …

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 …