There are many reasons why Appium location fails, but the element location code changes being the biggest reason.

For example, if the position changes, your xpath doesn’t work. Properties like ID change, and your location code will have to be maintained again.

Is there an algorithm that automatically identifies and maintains it for you? Of course, it is the WQRF family of tools

Today we are going to introduce wqRFnium_app, an automatic maintenance plugin for the Appium framework on Android

PIP Install is currently available for download.

Those who are familiar with or have used WQRFnium dealing with Selenium should be familiar with this. The WQRFNIum_app can be seen from its name that it is modified on the basis of WQRFnium and specially deals with appium Android terminal this time. The specific use method and principle are almost the same as before. It’s just different the first time you type an element.

Want to go to the familiar wqrfnium friend can enter the portal: wangzijia.blog.csdn.net/article/det…

Then wQRFNIUM_app is introduced as follows:

What is it?

It basically kills your Appium script. It enables automation to start on projects that would otherwise not be automated. It can instantly expand the job opportunities for automators. It can be in front of the girl to change the element to their own do not recognize the situation, still help you automatically locate.

How does it download?

PIP install wqrfnium_app can also be accessed by pYPI official website: pypi.org/project/wqr… To study the source code can go github:https://github.com/Woqurefan/wqrf_selenium then use this reference from wqrfnium_app. Wqrfnium_app import *

How does it work?

It is based on appium and page – object model: the beginning will be the default default location is stored in the elements method to locate elements and return, if found positioning fails, start the maintenance algorithm, maintenance algorithm will find the change of the element and returns, and the new way of locating the element/controls are stored by to use directly after.

Its performance?

If the default location mode is used, 0.04 seconds is required. Location failure – Start maintenance algorithm – Rewrite location – Save new location method Required: 1.08 seconds. The next location will use the new default location mode: 0.04 seconds.

How does it work?

Introduce begin_wqRF (‘ Your maintenance table absolute path/name ‘)

Maintenance in table:

Column 1: identification

Column 2: Temporary positioning mode

Column 3: temporary location values

Column 4: subscripts 0-999

Column 5: Leave it empty, all attributes aggregate string

Example: then call getelement(driver,’ button identifier ‘).click()

The elements that need to be maintained after the first entry must be correctly written in the first four columns.

After running the script once, the fifth column is automatically generated. Don’t pay attention.

If the element fails to locate due to UI changes, it will automatically find the most suitable new element based on column 5 and return it to you, and then automatically update the temporarily located column 234 and column 5 attribute aggregation string of the new element.

Its author?

Is the blogger himself: I go to hot meal, you have any questions can only post a message in this, the blogger desperately modify. You can also click on my personal homepage to view the contact information. Roughly:

Once downloaded, run it and let it generate a table for element.xls and then enter/maintain various elements in it. Begin_wqrf (‘./MyElements.xls’) is the code that defines the location of the Excel table, otherwise the table will be generated at the default location. The first run will stop the script if the table is empty because it has just generated elemensts.xls. Then just put the elements that change frequently in the script and introduce the getelement method of wqRFnium_app.wqRFnium_app, which needs to pass the driver and element identification. You can have wqRFNIUM_app automatically maintain this element. Wqrfnium_app also needs to distinguish which driver is used to locate which element

What are its advantages?

1. Easy to use, only need to change the positioning statement. 2. Simple source code, convenient for secondary development. 3. All the score weight parameters can be changed according to the company’s project style to achieve a success rate of more than 99%. 4. The blogger updates quickly, the framework is optimized and the outlook is very nice. 5. Support both PY2 and Py3

Its dependency modules?

1.appium

2.python-Levenshtein

3.python2/3

4.xlrd

5.xlutils

6.configparser

Unusual problem?

If there is an error when installing python-levenshtein, it is likely due to a c++ problem: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools” : visualstudio.microsoft.com/downloads/