Features
< Back to Blog Overview

HTC and Nexus testing

2012-07-02
Selenium Mobile Testing with Android: HTC, Nexus and Galaxy Tab
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn
  • Share on HackerNews

We have been offering Mobile Selenium Testing through our Selenium grid for a couple of months now. This weekend we optimized the Android emulator and we added new mobile devices: HTC Desire, Nexus One and Nexus S.


The Android Emulator has been notorious for being slow to start up, which is very inconvenient when you want to run tests against it. The reason it's slow, is because the Android emulator uses QEMU, which is a program that emulates ARM code (the code used by Android).


On our Ubuntu VMs we previously used the default ARM emulator to start up the Android emulator. These past few days we took a different approach and we now run on the x86 emulator, which is significantly faster in terms of starting and using the emulator.


The x86 emulator is included in the Android SDK. Using it means you need to specify Intel's x86 image as a target system image when creating an AVD (Android Virtual Device).

Together with some tweaking of the AVD's memory (RAM), you can make the emulator quite a bit faster. Since QEMU can only use 1 CPU core, it is recommended to get the fastest CPU possible.


Another important tip we'd like to share is to use the emulator's snapshot feature, which saves the emulator's state on disk. When you later start the emulator again, it will check for a snapshot image and use that as a starting point, meaning you can use it as a hibernation feature. Booting up the emulator will make sure you start off right where you stopped before.


Once you get to this point, you simply upload and install the WebDriver .APK and save the snapshot. Next time you start the emulator, it will be a lot faster. To keep the snapshot clean, use the -no-snapshot-save option. This will ensure the emulator will always start up with the WebDriver app ready to be used. Should the app crash during a test, it will not be saved to the snapshot, preventing a "corrupted" snapshot.


We also added a capability which you can pass along with your test, called landscape. When specified, it will run the emulator in landscape mode. If you do not specify this capability, we'll always run the emulator in portrait mode.

Our tunnel works seamlessly together with the emulator, which means you can test websites residing on your internal work right on the Android emulator. This works by setting QEMU proxy setting before starting the emulator. The only issue we discovered there is that QEMU proxy code only seems to proxy port 80. We will work on patching the QEMU code to accept different ports, but at first glance compiling it seems to be quite a challenge.


Right now we still use Ice Cream Sandwich, since a Jelly Beans Intel x86 image was not yet available. When available, we will update to Jelly Beans.


Together with Android testing, we also have been providing iOS (iPhone/iPad) testing for a couple of months now. iOS testing is also integrated with our tunnel, we provide screenshots and a video of your test and landscape mode is also supported.


Please let us know which other mobile devices you would like to run Selenium tests on.

TestingBot Logo

Sign up for a Free Trial

Start testing your apps with TestingBot.

No credit card required.

Other Articles

TestLab: run your tests and suites in our online CI

Lately we have been making some improvements to our TestLab. Our TestLab is a feature on our website which allows you to upload your Selenium IDE...

Read more
TestingBot and BrowserMob Proxy

Today we have added support for using a BrowserMob proxy together with our Selenium grid.

Read more
blank

Today we have added full support for Webdriver-backed Selenium, which allows you to use the two API's together in a single test. By using this f...

Read more
Test TV - Live video stream of your tests running in the Cloud

Today we released a new feature in our TestingBot member area called Test TV.

Read more
Selenium Tunnel - Run Selenium tests on your staging environment.

Today we are proud to release our new Selenium Tunnel, which will enable you to run Selenium tests on your local computer and network infrastruct...

Read more
iPhone and iPad Selenium Testing with Webdriver

Since our last post announcing Mac OS X Selenium support, we now have added iPhone and iPad to the mix.

Read more