appium supports APP automated testing of multiple architectures:
- Native application
- Hybrid application
- Pure web applications: such as mobile browsers, WeChat H5
Environmental preparation
Mobile terminal
- Browser under test: It is recommended to use the browser that comes with the phone, or the Chrome browser
PC side
- Install Chrome browser and be able to access Google
- Download the driver version corresponding to the mobile browser
Get mobile browser version information
$ adb shell pm list package | grep browser
package:com.android.browser
$ adb shell pm dump com.android.browser | grep version
versionCode=25 minSdk=25 targetSdk=25
versionName=7.1.2
$ adb shell pm dump com.android.chrome | grep version
versionCode=438909010 minSdk=21 targetSdk=30
versionName=89.0.4389.90
Client code
set capabilities
caps = dict()
caps["browserName"] = "Browser" # 默认为手机自带浏览器
caps["chromedriverExecutable"] = "driver存放地址" # 安装 appium 时默认会自带 chromedriver
Element positioning
Cannot locate elements through appium inspector / uiautomatorviewer
Need to rely on PC browser, enter
chrome://inspect
The subsequent operations are consistent with the parity mode of the PC browser
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。