Appnium+python implementation of gesture password why always error

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.