Sofia

Introduction
Philosophia Sofia
Chapter 0
Eclipse Install with ADT
Chapter 1
Getting Started with Android
Chapter 2
Structure of an Android Application
Chapter 3
Basic GUI-Driven Apps
Chapter 4
Testing GUI Apps
Chapter 5
Advanced Graphics
Gallery
Student Work Gallery
Appendix A
Sofia API
Appendix B
Demos and Downloads

Jump to...

  1. Why Test Your GUI?
  2. The Logistics of a GUI Test Case
  3. Writing a Test Script
  4. Common Problems with Android Testing

Chapter 4
Basic GUI-Driven Apps

Why Test Your GUI?

To be written.

The Logistics of a GUI Test Case

To be written.

Writing a Test Script

To be written.

Common Problems with Android GUI Testing

To be written.

Why do all of my tests fail with the exception java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission?

This most frequently happens if your phone or emulator is displaying the lock screen when you run your tests. Unlock the device and then run your tests again.

When I run my test cases, I get a cryptic error in the console that says "A fatal error has been detected by the Java Runtime Environment", or something similar, and the tests don't run.
Make sure that you choose Run As... > Android JUnit Test, not Run As... > JUnit Test. Even if you're only testing your data model and not a screen, if it's an Android application project, all tests must be executed on the emulator/device. (This is because, in a nutshell, Android uses a different executable format that desktop Java does not understand.)

© 2012–2013 Tony Allevato

Back to top