简体   繁体   中英

Android/iOS Test Automation: How to simulate complex gestures

Is there a Test Automation framework (for iOS/Android/multi-platform), that doesn't require access to the tested application's source code, that supports the ability to simulate complex gestures such as curved drag motions?

I see that most frameworks support the ability for point to point linear gestures, but I require non-linear motions.

On Android there is the Instrumentation API with which you can send arbitrary MotionEvents to your own Activities and Views. Check out the Instrumentation Javadoc . In particular the sendPointerSync(MotionEvent me) method. With that method you can send a series of motion events that represent whatever guesture you want.

Easiest way might be to set up a simple app to "record" motion events for you using a touch listener and store them in some way that you can then feed them in to the sendPointerSync() method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM