Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

(VI) use of appium 1.6and APP-inspector positioning

Shulou Source: shulou.com Published: 2022-06-03 04:27:51 10月01日 Update

Abandon uiautomation from 1.6th

Switch to xcuiteest mechanism

Environmental fundamentals: above xcode8,ios9.3

1. Install the latest version 1.6.3

Install cnpm: npm install-g cnpm-- registry= https://registry.npm.taobao.org

Install appium1.6.3: cnpm install-g appium@1.6.3

two。 Install appium-xcuitest-driver dependencies

Enter the WebDriverAgent installation directory: cd / usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent

Run bootstrap:

Mkdir-p Resources/WebDriverAgent.bundle sh. / Scripts/bootstrap.sh-d

3. Change the script configuration:

Add this apabilities

AutomationName, "XCUITest"

Source text: https://testerhome.com/topics/6962

New positioning tool: https://macacajs.github.io/app-inspector/cn/

App Inspector is a mobile device UI viewer running on the browser side, which uses the tree state structure to view the UI layout, and can automatically generate XPath, which is convenient for script writing and generation.

Installation

$npm install app-inspector-g (it will be slow to install directly, change this command: npm install app-inspector-g-- registry= https://registry.npm.taobao.org)

Use

$app-inspector-u YOUR-DEVICE-ID

Attachment: use instruments-s to get all current equipment information

After the operation, as shown in the following figure

(1)

(2) automatically open the interface shown in figure 2 above in the browser, and check its attributes, name,class,xpath, etc., by selecting the element on the left.

The original appium 1.5 positioning is mainly based on xpath, but the positioning effect is poor with name,class_name and so on.

The success rate of localization such as name,class_name in appium 1.6is high, and xpath is almost no longer used.

Http://www.cnblogs.com/hyddd/p/5571229.html Macaca is a lightweight Appium. You can try this.

Tags: Location browser script device browse generate run succeed use information element command foundation such as above attributes tools layout high success rate effect latest version Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Apple Docker Shulou Tech Info Microsoft