How to check if current Orientation is LandScape?

public boolean isCurrentOrientationLandScape(AppiumDriver driver) { String ort = driver.getOrientation().name(); ScreenOrientation orientation = ScreenOrientation.valueOf(ort); if (orientation == ScreenOrientation.LANDSCAPE) { return true; } else { return false; } }

Maximum frequency of keystrokes

Code: caps.setCapability(“maxTypingFrequency”, 15); Maximum frequency of keystrokes for typing and clearing a text field. If your tests are failing because of typing errors, you may want to adjust this. Values …

How to Swipe Left on the Element?

public void swipeLeftOnElement(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 find X and Y co-ordinate of a particular element?

WebElement acceptButton= driver.findElement(By.xpath(“//android.widget.Button[@resource-id=’com.pcloudy.appiumdemo:id/accept’]”)); By this below script we can get the xcordinate of the particular element acceptButton.getLocation().getX(); By this below script we can get the Ycordinate of the particular element …

How to enable wifi using appium in android local device ?

String adbCommand = “adb shell am broadcast -a io.appium.settings.wifi –es setstatus enable”; runCommand(adbCommand); public String runCommand(String command) throws InterruptedException, IOException { p = Runtime.getRuntime().exec(command); // get std output BufferedReader r …