Wqrfnium perfectly solves the problem caused by selenium’s inability to locate elements and the frequent changes in the front end leading to changes in various attributes of elements. Have you ever written a Selenium automation script and then, a few days later, an error was reported when it ran? The use case failed. Then, the location failed because the front end of the attribute of the element had changed. The cost of maintenance is too great. Many leaders will kill your Selenium automation initiative for the sake of the company. Once upon a time, the interview question asked: What are the use scenarios for UI automation? A: The front end doesn’t change very often.
But we don’t have to worry about that now. A tool for suppressing, resisting, and automatically maintaining element location failures due to frequent front-end changes has emerged. This tool is:
Wqrfnium What is it? It can make your Selenium script set work to death. It enables automation to start on projects that would otherwise not be automated. It can instantly expand the job opportunities for automators. It can change the elements to people don’t know, but it still knows.
How does it download? PIP install wqrfnium can also be downloaded from the pYPi website: pypi.org/project/wqr… Those who want to explore the source code can go to github: github.com/Woqurefan/w… Then use this quote from wqrfnium. Wqrfnium import *
How does it work? It is based on selenium 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.022 seconds is required. Location failure – Start maintenance algorithm – Rewrite location – Save new location method Required: 0.82 seconds. The next location will use the new default location mode: 0.022 seconds.
Its upgrade? It has not yet introduced AI to calculate the weight score of each attribute, this author will introduce it later, you can also use the default first, the success rate has reached 99%. Or tweak it yourself. The first version only supported element data in Excel tables, but various other types will be supported later. Since the principle is similar to appium, appium will be supported in the future.
Its author? Is the blogger: I go to hot meal, you have any questions can only post a message in this, the blogger desperately modify.
How does it work? Take a look at readme: github.com/Woqurefan/w…
Basically, once you download it, run it and let it generate a table for element.xls and then enter/maintain elements in it. Begin_wqrf (‘./ myelements2.xls’) is a custom excel table location code, otherwise the table will be generated in the default location. The first run will stop the script if the table is empty because it has just generated elemensts.xls. Then you just need to store the elements that change frequently, and then introduce the wqrfnium. Wqrfnium getelement method in the script, which needs to pass the driver and element identification. You can have wQRFnium automatically maintain this element. . Wqrfnium 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.selenium 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/ — — — — — — — — copyright statement: this article to CSDN blogger “I go to a hot meal” original articles, follow BY CC 4.0 – SA the copyright agreement, reproduced please attach the original source link, and this statement. Original link: blog.csdn.net/qq_22795513…