当前位置:网站首页>How many of the five app automated test AIDS have you used?

How many of the five app automated test AIDS have you used?

2022-06-23 21:23:00 Hemingway

UI When automating tests , First, locate the element to be operated , Then the instructions can be executed . On the web side, it is very convenient to pass devtools Tools ( That is to say, it is often said that F12) Get and write element positioning expressions .

But in mobile automation , This auxiliary tool still has a large optimization space . The list below 5 An element positioning aid I often use , And their strengths and weaknesses .

1、 Appium Inspector

Appium Inspector yes Appium Implemented page element viewer , The old version directly integrates appium In desktop applications , The new version will directly separate it , Made a gadget , Even if not used appium Do automated tests , You can also use this tool to locate elements , Positioning aids are also my default tools .

His advantages are :

1、 Stand alone tools , It can be downloaded separately

2、 Verify that the element expression is correct

3、 It can locate native applications , You can also locate hybrid applications and web page

The disadvantage is that it is troublesome to start , You need to configure parameters , The response speed is also slow ,web The page positioning function is relatively weak , Insufficient precision .

Installed directly on https://github.com/appium/appium-inspector download , Just like the installation of ordinary software , After startup, you need to configure parameters to indicate the mobile phone you are connected to 、 Platform information , It's also the trouble with this tool .

This is an example , Click when finished “start session" You can connect your mobile phone and start positioning . If you think it's troublesome to fill in parameters every time , Can be saved directly , Direct use next time .

 {
   "platformName": "Android",
   "appium:automationName": "Uiautomator2",
   "appium:packageName": "com.package.name",
   "appium:activity": ".lauchable.activity",
   "appium:chromedriverExecutable": "path/to/chromedriver.exe",
   "appium:deviceName": "emulator-5554"
 }

After getting the expression of the element in the page , The search button can be used to verify whether the specified element can be found in the page , This function is easy to use .

Uiautomatorviewer

This is Android sdk The tools included in the page , Install Android sdk after , Directly in \tools\bin In the directory uiautomatorviewer.bat Click the file to run . Its advantage is that Android comes with , Open the box , You can set a shortcut to the file , Click Run ; The disadvantage is that the function is relatively simple , Only basic element information can be obtained .

Weditor

weditor Is in atx A gadget under the ecology , Currently maintained by Alibaba , It supports self generation python uiautomator2 Code for , But if you don't u2, Then this function is useless . It also supports direct operation on the interface app, But this tool is not very stable , The connection is very easy to disconnect , And and appium Are not compatible , To locate, first appium Service disconnected ,appium The runtime also needs to put weditor To break off , The operation is cumbersome .

chrome inspect

This is positioning app Tools needed to embed web pages in , Common in mixed applications and web application . When app When entering a web page , Directly in chrome Browser's url Column input chrome://inspect You can enter the web debugging tool , The page will show which mobile devices are connected . It doesn't need to install any extensions , Browser built-in functions . Click on the page to directly open devtools Tools , And in browsing, press F12 There's no difference .

UC Devtools

This is a UC Web debugging tool developed by browser , Function and chrome inspect equally , Main positioning app Web page elements in . Open the website https://plus.ucweb.com/download/ Download complete .

原网站

版权声明
本文为[Hemingway]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/12/202112242154335467.html