本次以微信为例,

使用Appium自带的Inspector定位工具定位元素,

以及进行最最最简单脚本的录制:

capabilities = {
"platformName": "Android",
"platformVersion": "7.1.1",
"deviceName": "3216e430",
"browserName": "",
"appPackage": "com.tencent.mm",
# 微信包名
"appActivity": ".ui.LauncherUI",
# 微信启动页
"unicodeKeyboard": True,
"resetKeyboard": True,
"noReset": True,
"noSign": True
}

Appium Inspector定位元素与录制简单脚本

 

 

Appium Inspector定位元素与录制简单脚本

 

 

Appium Inspector定位元素与录制简单脚本

 

 

 Appium Inspector定位元素与录制简单脚本

 

 

Appium Inspector定位元素与录制简单脚本

 

Appium Inspector定位元素与录制简单脚本

 

Appium Inspector定位元素与录制简单脚本

 

 

 Appium Inspector定位元素与录制简单脚本

 

Appium Inspector定位元素与录制简单脚本

 

等待一会儿,进入微信启动页:

Appium Inspector定位元素与录制简单脚本

 

点击刷新,进入微信首页:

Appium Inspector定位元素与录制简单脚本

 

此时,可以分别定位“通讯录”、“发现”和“我”等元素:

Appium Inspector定位元素与录制简单脚本

Appium Inspector定位元素与录制简单脚本

Appium Inspector定位元素与录制简单脚本

 

 

下面开始进行录制简单的脚本,

模拟进入微信相册的第一条分享;

请注意这时候不要去管手机,

所有的操作都是在Appium上完成的:

 

Appium Inspector定位元素与录制简单脚本

Appium Inspector定位元素与录制简单脚本

Appium Inspector定位元素与录制简单脚本

Appium Inspector定位元素与录制简单脚本

Appium Inspector定位元素与录制简单脚本

Appium Inspector定位元素与录制简单脚本

Appium Inspector定位元素与录制简单脚本

Appium Inspector定位元素与录制简单脚本

Appium Inspector定位元素与录制简单脚本

 

这个脚本真是太太太简单了,

没有任何参考价值:

Appium Inspector定位元素与录制简单脚本

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
  • 2021-10-06
  • 2021-09-23
  • 2022-01-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-08
  • 2021-06-02
  • 2021-11-14
  • 2022-12-23
  • 2021-09-07
相关资源
相似解决方案