G
G
Guriyar2016-04-21 12:32:00
Android
Guriyar, 2016-04-21 12:32:00

UIAutomator: how to make a swipe in a certain time?

Good afternoon, colleagues!
I'm testing a toy for Android. And it is very important for me to complete the swipe for a strictly defined time. For example, 5 sec. I swipe using the UIDevice method:
boolean swipe(int startX, int startY, int endX, int endY, int steps)
Note that the last parameter is the number of steps. The documentation says:
"Performs a swipe from one coordinate to another using the number of steps to determine smoothness and speed. Each step execution is throttled to 5ms per step. So for a 100 steps, the swipe will take about 1/2 second to complete."
So for a 5 second swipe, I have to pass steps = 1000. Right? However, on one device I get a swipe in 25 seconds, and on the other in 88. It seems that the speed depends on performance. What to do and how to get at least approximately the same swipe time on different devices?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Guriyar, 2016-04-24
@guriyar

Sorry, false alarm.
After rebooting the device, the one on which the swipe was performed in 88 seconds, the swipe began to be performed in about the same 25 seconds. Empirically, it turns out that 1 step ~ 25 ms

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question