Android WebDriver without the SDK

The Android WebDriver docs imply that you need the Android SDK and a USB connection to run Selenium tests on an Android device. This is not the case. You can run the WebDriver APK and connect via Wi-Fi.

On your device:

  1. Enable non-Market apps (Settings > Applications)
  2. Download the latest android-server APK from
  3. Install the APK
  4. Launch WebDriver
  5. Determine your IP (Settings > Wireless & networks > Wi-Fi settings > SSID)

On your workstation:

  1. Confirm that WebDriver is running and available by browsing to http://device_ip:8080/wd/hub/.
  2. Run your Selenium script as usual (I use the Python bindings):
    from selenium import webdriver
    android = webdriver.Remote(command_executor='http://device_ip:8080/wd/hub',  desired_capabilities=webdriver.DesiredCapabilities.ANDROID)
    # File will be saved on your workstation, not the device

    Screenshot of from Android WebDriver

Leave a Reply

Your email address will not be published.