1

I'm curious how it's able to get the ID's of UI elements in android activities and simulate different events? Is it the same story for iOS?

4

2 回答 2

2

Internally, calabash uses an instrumentation backend that runs on the phone. This backend is an Android app wrapper around Robotium, which is a test automation library for Android. A lot of the UI functionality of Robotium can be found here, and, by browsing the code, you can have an idea of how some UI events are generated.

Here is, for example, how swipes are generated: it is just a good use of MotionEvent, judiciously placed to simulate a swipe.

于 2013-12-20T20:37:44.370 回答
1

On iOS, an HTTP server is embedded in your app. That HTTP server hosts routes that can be used for querying the view hierarchy and the internal state of your app. The server also serves as a bridge between your app and the UIAutomation JavaScript API; this is how gestures are performed.

于 2015-10-14T09:46:13.100 回答