O'Reilly logo

Mastering Selenium WebDriver 3.0 by Mark Collin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Automating the Android calculator

We are going to write a basic automation script that will enable us to perform some sums with the build in Android calculator. The first thing we are going to do is configure BasePageObject that all future page objects can extend as we did in our Selenium framework:

package com.masteringselenium.page_objects;import com.masteringselenium.AppiumBase;import io.appium.java_client.AppiumDriver;import io.appium.java_client.TouchAction;import org.openqa.selenium.support.ui.WebDriverWait;public abstract class BasePageObject {    AppiumDriver driver;    WebDriverWait webDriverWait;    TouchAction touchAction;    BasePageObject() {    try {    this.driver = AppiumBase.getDriver();        } catch (Exception ignored) { //This will be be thrown ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required