Writing an Appium Backend for a Game UI Library

As I’m sure you guys know, Appium is not as useful for games on mobile devices, since they do not usually use the native UI libraries on Android and iOS. My team is working on a game with our own UI library that draws directly to OpenGL. We have been using Appium to simply click on points of the screen to drive our game’s UI and perform simple UI tests. However, we were interested in seeing if we could create a new Appium backend that could talk to our UI library to get the IDs and positions of elements and interact with them.

Conceptually, I imagine we would have to open a socket in our game to listen to commands coming from Appium. Then, so long as our UI library implements and exposes certain features–getting list of elements, their IDs, and positions and interacting with them–we would be able to respond to Appium’s commands.

Has anything like this been attempted before? Does this even sound like a reasonable idea?

Cheers,
Gabe

It’s a completely reasonable idea!

Opening a socket in your game, exposing the ability to find and interact with elements, is exactly how you’d go about it.

We’re currently working on appium version 1.5 (about two weeks away from a working beta). This version doesn’t really add new features, but involves major code refactoring that will make it much much simpler to implement your own custom driver. Appium drivers are now each their own self-contained npm module, extend a common BaseDriver class, and can draw from a huge pool of appium utilities.

If your interested in creating a new driver, email me at [email protected] and we can help walk you through the new (simpler!) architecture :smile: (plus help us develop docs so others may freely implement their own drivers as well)