简体   繁体   中英

Android test automation: Drawn pattern assertion on screen

My application draws a pattern on the screen (sketching). Is there a method through which I could automate drawing a simple pattern (eg solo.drag(fromX, toX, fromY, toY, stepCount) in Robotium) and testing if this pattern has been shown correctly on the screen of the device? Some of the test parameters could be length of the drawn line and weight of the stroke. Is there any testing framework which could help me with this?

One method I could think of is image comparison, wherein I compare a screenshot of my test application with an ideal scenario image which is already stored in my memory, but I don't believe this might be a very efficient one.

You can use UiAutomator. It is the mot simple way to draw.

getUiDevice().swipe(int startX, int startY, int endX, int endY, int steps);

Get the values X and Y from your phone and trie to find a pattern suitable for more devices

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