Recently has been trying to appnium implementation of Android phone automation testing, has been stuck at a point, that is, gesture password, because the application of the gesture password used is not a single imageview implementation of the Gesture Password unlock window, so can only rely on coordinate points to locate. On the web, the Appnium code for unlocking gesture passwords written in Python is as follows:
1 Action = touchaction (driver)2 unlock = action.press (x=240, y=915). Wait (ms=100)3 . move_to (x=480, y=0). Wait (ms=100)4 . move_to (x=480, y=0). Wait (ms=100) 5 . Release (6) Print Unlock 7 Unlock.perform ()
But why do you always make an error when you do it:
The coordinates provided to an interactions operation is invalid.
There are two pits in this code, uh, the key point:
The coordinates in the 1.press method are absolute coordinates, and the coordinates in the Move_to method are relative coordinates, specifically the coordinates in the first move_to relative to the coordinates in the press method, and the coordinate in the second Move_to method relative to the coordinates in the first move_to method.
2.wait is required: Here MS is expressed as milliseconds, ms=100 is waiting 100 milliseconds. It's too soon to go wrong.
These two key points stuck to me one day ... Write it out for everyone to see, maybe it will be the same problem.
Appnium+python implementation of gesture password why always error