-
Notifications
You must be signed in to change notification settings - Fork 2
6 Gestures_features
Martin Großmann edited this page Jun 20, 2024
·
2 revisions
We provide the AppiumUtils
to use special mobile gestures and other Appium like features.
WebDriver driver = WEB_DRIVER_MANAGER.getWebDriver();
new AppiumUtils().rotate(driver, ScreenOrientation.LANDSCAPE);
// Start iOS settings
new AppiumUtils().launchIOSApp(driver, "com.apple.Preferences");
// Run a native command at Android for wifi settings
new AppiumUtils().runCommand(driver, "am", "start", "-a", "android.settings.WIFI_SETTINGS");
Use the MobileChecker
to get the used platform at runtime.
Platform platform = new MobileOsChecker().getPlatform(webDriver);
// returns Platform.IOS or PLATFORM.ANDROID
Swipe gestures can be performed according to the directions of the compass on the device.
// Swipe from the left to the right in the middle of the screen.
new AppiumUtils().swipe(this.getWebDriver(), AppiumUtils.Swipe.LEFT);
// Do a scroll down
new AppiumUtils().swipe(this.getWebDriver(), AppiumUtils.Swipe.DOWN);