O'Reilly logo

Selenium Testing Tools Cookbook by Unmesh Gundecha

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

Running tests using AndroidDriver

Once we have the Android server APK installed and configured on the Android emulator or device, we can create and run the tests using the AndroidDriver class.

In this recipe, we will test a simple mobile BMI calculator web application developed using jQuery Mobile on the iOS platform.

Getting ready

Before we start running the test with AndroidDriver, set up the Android emulator or device with the following steps:

  • Set up the Android emulator or a real device with the Android server APK
  • Set up the port-forwarding by using the following command:
    adb -s <serial_id> forward tcp:8080 tcp:8080
    
  • Set up a new Java project
  • Add the WebDriver JARS to the project's build path
  • Add the JUnit library to the project

How to do it...

To execute ...

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