Essential Guide

Enterprise architects' guide to success with mobile apps for business

A comprehensive collection of articles, videos and more, hand-picked by our editors

Android testing: Expert gives step-by-step guidance to mobile testers

Test expert Matt Heusser gives Web app developers specific instructions for Android testing.

Android

More information about mobile testing

This is the third part in a three-part series on mobile testing.

In the first part, you’ll find tips for testing mobile apps.

In the second part, Heusser covers testing iOS apps.

Some older Android devices have a stock browser that isn't Chrome. On those devices, you can get the JavaScript output by typing "About:Debug" into the URL bar and clicking "Go". For example, go to Websandbox-code.org/samples and click the "Generate Error" button. Click "OK", then try going to the URL, "About:Debug".

For newer versions of Android, you'll need to download developer tools.

Developer tools

The way you hook into developer tools with Android is tied directly to developer tools on the traditional Web browser, which I mentioned earlier. Basically you plug the Android device into your computer, have Chrome recognize the device -- thanks to some software you'll install -- and then use Chrome's debugger to debug your Android device.

Here's how to do it:

Android Debug Bridge Chrome extension
Figure 1

First, read the developers guide for debugging Chrome mobile. Note that if you are running on a Windows machine, you'll need USB drivers for your Android device. Most manufacturers have an easy shortcut to find the page for the drivers, but here's a link for Samsung Galaxy Nexus, and another for the Galaxy S3. Setting up the drivers is beyond the scope of this document and can be a bit tricky on devices outside the mainstream.

Android chrome browser advnced
Figure 2

After the drivers are installed, load up the Android Debug Bridge (ADB) Chrome extension available in the Chrome Web store. Note that on Windows 8, the extension will need to be manually installed and updated; details on that can be found in the Chrome Web store. It is not as scary as it sounds. Simply download the extension and drag it into the Chrome Extension Manager tab. (Figure 1)

On your mobile device, launch the Chrome Browser App, open Settings > Advanced > Developer tools; then make sure "Enable USB Web debugging" is checked. (Figure 2)

Chrome DevTools devices
Figure 3

Then, in the desktop browser, use the extension button to enable ADB and "View Inspection Targets"; a screen like the one in Figure 3 will show.

After everything is connected (including your physical connection), find the target device and click "Inspect". From here, debugging is much like developer tools on a desktop machine.

Chrome DevTools cookies
Figure 4

Figure 4 shows a list of the cookies on the phone.

Console, network and the rest of the usual suspects are there too. Poke around and see what is available; this really is a valuable tool for finding Web application problems. Note that while running the remote debugging tools, there were some issues with capturing screenshots. The screenshots would show up as zero byte files. Unplugging and re-plugging the USB allowed for normal retrieval of the screenshots.

Android incognito tab
Figure 5

Private browsing

For the "Browser" Andriod app, start an "incognito" tab from the app menu (Figure 5).

Chrome for Android is nearly the same. Note that Chrome has a button to switch between normal and incognito tabs (Figure 6).

Android new tab
Figure 6

Screen captures

Modern versions of Android (4.0+) have a screen capture feature – "power" and "volume down" at the same time. This has been standardizing in recent Android releases (4.0+). Older versions are very manufacturer- and model-specific and may require a third-party app. The screen capture goes to the device's images, which you can recover to your laptop with a USB cable.

Note that Windows XP and Windows 7 like to have the device presented on USB in different modes. When the device is connected, use the quick settings and select "Connected as media device" or "Connected as USB storage" to change the mode (Figure 7).

Android settings storage
Figure 7

Throttling bandwidth

The easiest way to do this on an Android device is probably to set up your own wireless network, perhaps configuring your laptop as a wireless access point with a tool like Connectify. Once the laptop is an access point, you can use something like ipfw to throttle bandwidth on the laptop. You can read more about ipfw in this SSQ article.

For GPS-aware apps, fake your location

If your application uses the phone's GPS, you could take it for a drive, but you can also use an application to override the native GPS, replacing your actual location with values you select. Fake GPS for Android is one application that can do this. Ajay Balamurugadas, a software tester based in Bangaluru, India, uses Fake GPS extensively on location-aware applications to see if the application can recognize the data as "fake," to see how the map renders directions in different locations, and to do quick feature checks.

This was first published in March 2014

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Essential Guide

Enterprise architects' guide to success with mobile apps for business

3 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchSOA

TheServerSide

SearchCloudApplications

SearchAWS

SearchBusinessAnalytics

SearchFinancialApplications

SearchHealthIT

Close