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


机智的测试生活
88 声望478 粉丝

公号|机智的测试生活