Time for action – installing the Android Server - Selenium

In this section, we will learn the steps required to install the Android server on the device or emulator that you are going to be using. To do this, you will need to have downloaded the APK file from http://code.google.com/p/selenium/downloads/list. If you are installing this onto a real device make sure that you allow installs from Unknown Sources.

  1. Open a command prompt or a terminal.

  2. Start the emulator or device if you haven't already.

  3. We need to run the available devices:
    <path to>/android_sdk/platform-tools/adb devices

  4. It will look like this:

    • daemon not running, starting it now on port 5037 *
    • daemon started successfully *
    • List of devices attached 3930AZ598Z6000ECdevice

  5. Take the serial number of the device.

  6. Now we need to install. We do that with the following command:
    adb -s <serialId> -e install -r android-server.apk

  7. Once that is done you will see this in the command prompt or terminal:
    3594 KB/s £1881490 bytes in 0,511s)
    pkg: /data/local/tmp/andraid-server-Z.Z1.0.apk
    Success

  8. And on the device you will see:

What just happened?

We have just seen how we can install the Android Server on the server. This process is useful for installing any Android app from the command line. Now that this is done we are ready to start looking at running some Selenium WebDriver code against the device.

Creating a test for Android

Now that we have looked at getting the device or emulator ready, we are ready to start creating a test that will work against a site. The good thing about the Selenium WebDriver, like Selenium RC, is that we can easily move from browser to browser with only a small change. In this section, we are going to be introduced to the AndroidDriver.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Selenium Topics