当前位置:网站首页>Appium基础 — Appium Inspector定位工具(一)
Appium基础 — Appium Inspector定位工具(一)
2022-07-06 18:03:00 【测试-八戒】
1、Appium Inspector介绍
之前我们说过Appium Server有两种启动方式,
- 一种是
Appium Desktop有图形界面的启动方式,称之为桌面版; - 另一种版本是通过 npm 安装,使用命令行参数启动的Appium Server。
而Appium Inspector工具就在Appium Desktop中,Appium Inspector是Appium Desktop附带的一个元素定位检查器,用来调试定位应用程序很方便。Appium Inspector工具同时支持Android系统和IOS系统中原生界面的元素定位。
2、Appium Inspector打开方式
Appium Desktop安装完成之后,双击打开。

说明:界面有 3 个 Tab 选项
- Simple:默认配置,监听本机 4723 端口;
- Advanced:高级设置,可以自定义 Appium server 端的配置,配置好后可以保存到Presets;
- Presets:修改Advanced高级设置中的配置项。
一般我们测试直接使用 Simple 即可,点击 Start Server 按钮,启动 Appium server,并开启监听本机 4723 端口。
开启服务后,界面跳转到服务端控制台,如下图:

提示:
控制台显示运行的脚本中的日志信息,右上角有 3 个按钮,分别是:
- 第一个按钮 Start Inspector Session,开启 Appium Inspector 定位工具;
注意:inspector 会新开一个 Session; - 第二个按钮 Get Raws Logs,下载当前控制台中的 log 信息;
- 第三个按钮 Stop Server,关闭当前的 Appium server。
有两种方式可以打开Appium Inspector工具, - 方式一:点击右上角三个按钮中的第一个(一个放大镜样子的按钮),打开
Appium Inspector工具。 - 方式二:点击左上角
File-->New Session Window... Ctrl+N也可以打开Appium Inspector工具。
如下图:

Appium Inspector工具开启后的界面如下图:

3、Appium Inspector布局介绍

说明:
- 布局1是Appium Inspector服务的设置
Automatic Server:自动服务器Custom Server:定制服务器Select Cloud Providers:选择云提供商
我们一般使用Automatic Server即可:Will use currently-running Appium Desktop server http://localhost:4723
将使用当前运行的Appium桌面服务器http://localhost:4723。 - 布局2是高级设置
可以设置:Allow Unauthorized Certificates:允许未经授权的证书Use Proxy:使用代理服务器
初学一般我们不进行高级设置。 - 布局3是Desired Capabilities参数设置
Desired Capabilities: 编写Desired Capabilities参数Saved Capability Sets:已保存的Desired Capabilities,可以进行查看和修改。Attach to Session...:附加到会话...(用到的时候在说)
4、Appium Inspector工具的配置
1)Appium Inspector工具使用前提
- 打开
Appium Desktop,开启Appium Inspector工具。 - 所测试设备是开机状态(手机或者虚拟机)。
- 确保电脑与设备是链接状态,也就是
cmd进入命令行终端,
输入adb connect 127.0.0.1:21503链接逍遥模拟器,
输入adb devices能够获取设备名称。
2)Appium Inspector的服务器设置和高级设置
- 服务器设置:选择
Automatic Server(一定要记得点击一下,进行选中) - 高级设置:不进行设置
3)编写Desired Capabilities参数(重点)
可以在左侧一行一行手动添加,如下图:

提示:第二列的格式是针对第三列value而言的。
也可以把Json格式的数据编辑好,直接粘贴在右侧JSON Representation里。

直接把Json格式的数据直接粘贴过来

点击保存之后,数据会同步到左侧,如下图:

4)保存Desired Capabilities参数
如有需要,在编辑完成Desired Capabilities参数之后,可以对其进行保存,方便以后的管理和使用。


5)查看和修改已存储的Desired Capabilities
点击Saved Capability Sets标签页,可以查看和修改已存储的Desired Capabilities。

6)开启Session,连接手机获取手机界面
点击Start Session,开启使用Appium Inspector工具,如下图:

说明
- Appium Inspector需要我们手动创建一个session,其实也就是一个客户端,和Appium server连接,并且需要在Desired Capabilities里面填入一些参数。
- 所需功能是在Desired Capabilities对象中编码的键和值,当请求新的自动化会话时,由Appium客户端发送到Appium server服务器。Desired Capabilities告诉Appium驱动程序有关您希望测试如何工作的各种重要信息。最终Desired Capabilities将作为JSON对象发送到Appium。
- 所需功能的Desired Capabilities对象可以在WebDriver测试中编写脚本,也可以在Appium Server GUI中设置(通过Inspector会话中,就是上边的介绍方式)。
提示:
当Appium Inspector能够不能抓取手机屏幕时,可以关闭和重启adb服务,或者重启Appium Inspector服务。 - adb kill-server
- adb start-server
重点:配套学习资料和视频教学
那么在这里我也精心准备了上述大纲的详细资料在下方链接如下


边栏推荐
- 从零开始匹配vim(0)——vimscript 简介
- Meet in the middle
- Send template message via wechat official account
- Start from the bottom structure to learn the customization and testing of fpga---- FIFO IP
- HMM 笔记
- 增加 pdf 标题浮窗
- Add the applet "lazycodeloading": "requiredcomponents" in taro,
- 分享一个通用的so动态库的编译方法
- AcWing 1142. 繁忙的都市 题解(最小生成树)
- Spark TPCDS Data Gen
猜你喜欢

Yunna | work order management software, work order management software app

c语言—数组

2022 Google CTF segfault Labyrinth WP

Send template message via wechat official account
![[signal and system]](/img/aa/a65d6da1d1d9410254ca7b775e24a6.png)
[signal and system]

Asset security issues or constraints on the development of the encryption industry, risk control + compliance has become the key to breaking the platform

HMM 笔记

405 method not allowed appears when the third party jumps to the website

Lldp compatible CDP function configuration

对C语言数组的再认识
随机推荐
7.6模拟赛总结
云呐|工单管理办法,如何开展工单管理
POJ 3177 Redundant Paths POJ 3352 Road Construction(双连接)
The cost of returning tables in MySQL
前置机是什么意思?主要作用是什么?与堡垒机有什么区别?
Transformation transformation operator
LeetCode. 剑指offer 62. 圆圈中最后剩下的数
Telnet,SSH1,SSH2,Telnet/SSL,Rlogin,Serial,TAPI,RAW
Receive user input, height BMI, BMI detection small business entry case
2022 Google CTF SEGFAULT LABYRINTH wp
Amway wave C2 tools
域分析工具BloodHound的使用说明
Installation and testing of pyflink
字节P7专业级讲解:接口测试常用工具及测试方法,福利文
负载均衡性能参数如何测评?
What does front-end processor mean? What is the main function? What is the difference with fortress machine?
C language instance_ four
go-zero微服务实战系列(九、极致优化秒杀性能)
Machine learning: the difference between random gradient descent (SGD) and gradient descent (GD) and code implementation.
从底层结构开始学习FPGA----FIFO IP的定制与测试