public boolean Method_isCurrentOrientationPortrait(AppiumDriver driver) { String ort = driver.getOrientation().name(); ScreenOrientation orientation = ScreenOrientation.valueOf(ort); if (orientation == ScreenOrientation.PORTRAIT) { return true; } else { return false; } } Read More
Categories : Uncategorized
Posted by Ahmad Sayeed
No Comments
public boolean isCurrentOrientationLandScape(AppiumDriver driver) { String ort = driver.getOrientation().name(); ScreenOrientation orientation = ScreenOrientation.valueOf(ort); if (orientation == ScreenOrientation.LANDSCAPE) { return true; } else { return false; } } Read More
Categories : Uncategorized
Posted by Sridatta Pani
No Comments
public void pressAndroidMenu(AppiumDriver driver) { AndroidDriver androidDriver = (AndroidDriver) driver; androidDriver.pressKey(new KeyEvent(AndroidKey.MENU)); } Read More
Categories : Uncategorized
Posted by Shah Nawaz
No Comments
private void swipeOnSeekbar(AppiumDriver driver, WebElement element, int percentage) { Point point = element.getLocation(); Dimension eleSize = element.getSize(); int startX = point.getX(); int startY = point.getY() + (eleSize.getHeight() / 2); int moveToX = point.getX() + (eleSize.getWidth() Read More
Categories : Uncategorized
Posted by Ahmad Sayeed
No Comments
public void longPressOnElement(AppiumDriver driver, WebElement elment) { new TouchActions(driver).longPress(elment).perform(); } Read More
Categories : Uncategorized
Posted by Shibu Panda
No Comments
Code: caps.setCapability("ignoreAboutBlankUrl", true); Ignore webviews which are pointed to the about:blank url. These webviews will not appear in the context list and you cannot set the context to these webviews. Value: true/false Read More
Categories : Uncategorized
Posted by Ahmad Sayeed
No Comments
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 chromedriverPorts capability. Value: Numeric values Read More
Categories : Uncategorized
Posted by Shibu Panda
No Comments
16 October

Orientation

Code: caps.setCapability("androidNaturalOrientation", true); "Some devices are meant to be used primarily in a widescreen orientation. For this set of devices, it might make more sense to think of the default wide mode as PORTRAIT orientation, Read More
Categories : Uncategorized
Posted by Shah Nawaz
No Comments
Code: caps.setCapability("allowInsecurity", "shell"); "Allows security relaxation only for specific functionalities. For example: You can allow relaxed security just for the android shell" Value: Shell / fastboot Read More
Categories : Uncategorized
Posted by Shah Nawaz
No Comments
16 October

Unlock type

Code: caps.setCapability("unlockType",pattern); "Used to select a method of unlocking the device.If set to null, the Appium Settings App is used to unlock the device. For how to unlock via PIN or Pattern see: https://github.com/appium/appium-android-driver/blob/master/docs/UNLOCK.md" Value: Read More
Categories : Uncategorized
Posted by Ahmad Sayeed
No Comments