{
"deviceName": "396f68f07d94",
"automationName": "uiautomator2",
"platformName": "Android",
"noReset": true,
"autoLaunch": false,
"appPackage": "xxx.x.x.xx",
"appActivity": "x.x.x.x.Activity",
"unicodeKeyboard": false,
"resetKeyboard": true,
"noSign": true,
"platformVersion": "7.1.2"
}
{
"deviceName": "iphone8plus",
"platformVersion": "11.2.5",
"udid": "c65d00a8cda9947953dac52e92071aa1481f23a2",
"automationName": "XCUITest",
"noReset": false,
"platformName": "iOS",
"bundleId": "xx.xxx.xx.x",
"autoLaunch": false
}
//唯一标识
Find By Selector
id com.benqu.wuta:id/home_camera_view
xpath /hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.ImageView
//属性
Attribute Value
NAF true
index 0
text 相机
class android.widget.ImageView
package com.benqu.wuta
content-desc 进入相机
checkable false
checked false
clickable true
enabled true
focusable false
focused false
scrollable false
long-clickable false
password false
selected false
bounds [245,1071][475,1301]
resource-id com.benqu.wuta:id/home_camera_view
instance 8
WebElement webElement=driver.findElementById("com.benqu.wuta:id/home_camera_view");
WebElement webElement=driver.findElementByAndroidUIAutomator("new UiSelector().text(\"相机\")");
WebElement webElement=driver.findElementByAccessibilityId("进入相机");
WebElement webElement=driver.findElementByClassName("android.widget.ImageView");
WebElement webElement=driver.findElementByXPath("/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.ImageView");
Find By Selector
accessibility id 企业微信
xpath //XCUIElementTypeIcon[@name="企业微信"]
Attribute Value
type XCUIElementTypeIcon
name 企业微信
label 企业微信
enabled true
visible true
x 199
y 378
width 64
height 86
WebElement webElement=driver.findElementByAccessibilityId("企业微信");
WebElement webElement=driver.findElementByXPath("//XCUIElementTypeIcon[@name=/"企业微信/"]");
java
WebElement webElement=driver.findElementByIosNsPredicate("label == '企业微信'");