Automation Testing of Sencha Touch based Android application


Problem Statement:

Complexities of the software applications are increasing with tremendous pace these days. Every day a new set of functionality is being added. It is the quality assurance team responsibility to make sure existing functionality will not break because of new changes and whole software application works as smooth as possible. Testing entire application for each change is desirable, but doing it manually is time consuming and may not give expected benefits.

Automation testing is the best way to overcome this problem. Prepare automation scripts and run them any number of times you want as per the project need. This saves lot of manual effort. Many automation testing tools are available for client and web based applications. As mobile platform is still evolving, we cannot find lot of automation test tools for mobile applications. But automation testing of mobile application is very much needed.

Scope of Article:

This article talks about steps to perform automation testing of Sencha Touch based application with Selenium Web driver in Andriod emulator. This article automates functional testing of sample registration application. You can download sample registration application from following link


This article assumes that you know about selenium web driver, if you are not familiar about selenium webdriver you can read about selenium web driver here.


  • Sencha Touch 2.2
  • Selenium java webdriver 2.30.0 jar
  • Junit 4.10
  • Maven
  • Andriod SDK 20130219

Use cases:

Sample registration application takes set of input parameters to complete registration. Below diagram shows UI of sample registration form


As part of this article we prepare and run automation test script to fill all the fields of registration form and complete registration.


 Andriod installation and Emulator setup:

  1. Download Andriod SDK(  and unpack it and keep in the same folder where you have selenium testing java project is in place. Here webdriver folder contains java project for selenium testing


  2. Now install emulator for Andriod by using andriod sdk
    [suman@localhost webdriver]  $ cd andriod_sdk/tools/                                        [suman@localhost tools]$ ./android create avd -n my_andriod -t 1 -c 100M
  3. Start emulator device in your machine. You need to pass AVD name i.e. ‘my_andriod’ which is mentioned in last stepStartEmulator
  4. Verify whether emulator is running or not and note the down the device id to use in next steps                           EmualtorDeviceIt indicates emulator is running and device name is ’emualtor-5554′. This device id is used in next steps
  5. Download andriodserver from
  6. Install Andriod server
               ./adb -s 'emulator-5554' -e install -r  android-server.apk
  7. Now run Andriod WebDriver application
    [suman@localhost platform-tools]$ ./adb -s 'emulator-5554' shell am start -a android.intent.action.MAIN -n
    Starting: Intent { act=android.intent.action.MAIN }
  8. Now setup the port forwarding in order to forward traffic from the host machine to the emulator
    $./adb -s 'emulator-5554' forward tcp:8080 tcp:8080
  9. With this emulator andriod setup and emulator is ready for use

 Create Maven based project for Selenium WebDriver:

  1. Sample pom.xml looks like as below
    <project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
  2. Create a new unit test class for testing of touch application
    package webdriver.regresssion;
    import org.junit.Test;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    public class andriodsenchatouch {
    public void launchTouchApplication() {
    WebDriver driver = new AndroidDriver();
    // Find the text input element by its name
    WebElement userName = driver.findElement("username"));
    // Enter something to search for
    // Now submit the form. WebDriver will find the form for us from the element
    // Find the text input element by its name
    WebElement password = driver.findElement("PassWord"));
    // Enter something to search for
    // Now submit the form. WebDriver will find the form for us from the element
    // Find the text input element by its name
    WebElement reenterpass = driver.findElement("ConfirmPassword"));

    // Enter something to search for
    // Now submit the form. WebDriver will find the form for us from the element
    // Find the text input element by its name
    WebElement okbutton = driver.findElement("q"));
    // Enter something to search for;
    // Check the title of the page
    System.out.println("Page title is: " + driver.getTitle());
  3. Now script is ready for automation testing of sample registration application

 Run prepared automation test scripts:

  1. Click on ‘Menu button in Emualtor, now on screen it shows WebDriver, that means emulator is ready for testing


  2. Now go to unit test file and debug it


  3. Now Sencha Touch application is launched in an EmulatorLaunchApplication


In this article we saw how we could perform automation of testing of Sencha Touch based application by using selenium webdriver

References :

Tagged with: , ,
Posted in Sencha Touch

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

We Have Moved Our Blog!

We have moved our blog to our company site. Check out for all latest blogs.

Sencha Select Partner Sencha Training Partner
Xamarin Authorized Partner
Do More. With Sencha.

Recent Publication
%d bloggers like this: