Join the webinar on 'Open source GenAI tools for Test Automation' on May 28th or May 30th.
Donating Holiday Cheer Using Appium

Donating Holiday Cheer Using Appium

December 26, 2018
 Jonathan Lipps Jonathan Lipps
Jonathan Lipps

As this is the last Appium Pro edition of 2018, I thought it appropriate to take a few moments and reflect on what we're all doing here. Whether you celebrate Christmas, Hanukkah, Kwanzaa, Festivus, the Winter Solstice, or nothing in particular, the fact that you're reading my online newsletter about mobile app testing probably means you have something to celebrate.

I'm not saying life is easy for any of us, and I'm not saying that end-of-year holidays are always filled with joy--they can certainly be filled with heartbreak too, no matter how well-off we are. But I am saying that it's worth reflecting on the opportunities open to us in virtue of our experience with software development and/or testing. I'm grateful that I can spend a portion of every week thinking about fun and interesting things to do with Appium, and I'm even more grateful that there are some of you out there in the world who find these little guides worth reading. When I stop and think about the reality of how I get to live my life, I'm overwhelmed by the truth that there's nothing particularly "fair" about it.

OK--this project is called "Appium Pro" and not "Philosophical Ethics Pro", so I won't belabor the point any further. I just wanted to give us all a brief moment to pause, detach from the technical details for a moment, think about what it means for us to be humans (even technologically-oriented humans), and have regard for those of our fellow human beings who are worried about much more urgent problems than how to solve the next automation challenge at work.

In that spirit, I offer you a different kind of code sample today, one that you could use to donate to a variety of charities. I've chosen to write this little script to donate to Raising the Roof, a homelessness solutions charity here where I live in Canada. (The script will work for any charity using's platform, though it was not easy to find a list of such organizations). But find your favorite charity and write your own donation script! I just ran mine and it gave me a little thrill of holiday cheer. Let me know if you do something similar and I'll give you a shoutout in 2019!

See you all next year.

import io.appium.java_client.ios.IOSDriver;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;

public class Edition049_Holidays_2018 {
    private IOSDriver driver;
    private WebDriverWait wait;

    private static String CHARITY_URL = "";
    private static String DONATION_AMT = "25";
    private static String EMAIL = "";
    private static String FIRST_NAME = "Your";
    private static String LAST_NAME = "Name";
    private static String STREET = "123 Main Street";
    private static String CITY = "Vancouver";
    private static String COUNTRY_CODE = "CA"; // 2-digit country code
    private static String STATE_CODE = "BC";
    private static String POSTAL_CODE = "V6K 123";
    private static String PHONE = "555-555-5555";
    private static String CARD_NAME = FIRST_NAME + " " + LAST_NAME;
    private static String CARD_NUMBER = "1234 5678 9012 3456";
    private static String CVV2 = "123";
    private static String CARD_TYPE = "Visa"; // 'Visa' or 'Mastercard'
    private static String CARD_MONTH = "01";  // 2-digit month
    private static String CARD_YEAR = "21";  // 2-digit year

    private static By donationAmt ="ContributionAmount");
    private static By donorEmail ="Email");
    private static By donorFirstName ="FirstName");
    private static By donorLastName ="LastName");
    private static By donorStreet ="Street");
    private static By donorCity ="City");
    private static By donorCountry ="Country");
    private static By donorState ="State");
    private static By donorPostalCode ="ZipCode");
    private static By donorPhone ="PhoneDay");
    private static By donorCardName ="CardName");
    private static By donorCardNumber ="CardNumber");
    private static By donorCVV2 ="CVV2");
    private static By donorCardType ="CardType");
    private static By donorCardMonth ="ExpiryMonth");
    private static By donorCardYear ="ExpiryYear");
    private static By submitDonation ="gtSubmitButton");

    public void setUp() throws MalformedURLException {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("platformName", "iOS");
        capabilities.setCapability("platformVersion", "11.4");
        capabilities.setCapability("deviceName", "iPhone 6");
        capabilities.setCapability("browserName", "Safari");

        driver = new IOSDriver<>(new URL("http://localhost:4723/wd/hub"), capabilities);
        wait = new WebDriverWait(driver, 10);

    public void tearDown() {
        if (driver != null) {

    public void testHolidayCheer() {
        new Select(driver.findElement(donorCountry)).selectByValue(COUNTRY_CODE);
        new Select(driver.findElement(donorState)).selectByValue(STATE_CODE);
        new Select(driver.findElement(donorCardType)).selectByValue(CARD_TYPE);
        new Select(driver.findElement(donorCardMonth)).selectByValue(CARD_MONTH);
        new Select(driver.findElement(donorCardYear)).selectByValue(CARD_YEAR);

Donating Holiday Cheer Using Appium

4 Parts


Perfect Digital Experiences with Data Science Capabilities

Utilize HeadSpin's advanced capabilities to proactively improve performance and launch apps with confidence
popup image