automated.platforms.mobile.android.AndroidActions Maven / Gradle / Ivy
package automated.platforms.mobile.android;
import io.appium.java_client.TouchAction;
import io.appium.java_client.android.AndroidDriver;
import automated.reporting.TestReporter;
import automated.test_manage.config.Platform;
import automated.reporting.TestReporter;
import automated.test_manage.config.Platform;
/**
* Created by Ismail on 1/5/2018.
* This Class contains all related methods and their implementation
* for Android application actions
*/
public class AndroidActions {
/*************** Class Methods Section ***************/
// This method to do Pull to Refresh action
public static void pullToRefresh() {
try {// Call TouchAction for android Driver object then press screen
// with do moving down on the screen
new TouchAction((AndroidDriver) Platform.driver).press(170, 400)
.moveTo(170, 980).release().perform();
// If screen Refresh success report step as passed
TestReporter.pass("Screen Refresh successful");
} catch (Throwable throwable) {
TestReporter.fail("Unable to pullToRefresh screen, Please check" + "error log: " + throwable.getMessage(), true);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy