- 概述
- 用户界面自动化
- 关于“用户界面自动化”活动包
- 通过用户界面自动化实现自动化的应用程序和技术
- 项目兼容性
- UI-ANA-016 - 拉取打开浏览器 URL
- UI-ANA-017 - 出错时继续 True
- UI-ANA-018 - 列出 OCR/图像活动
- UI-DBP-006 - 容器使用情况
- UI-DBP-013 - Excel 自动化误用
- UI-DBP-030 - 选取器中的禁止变量使用情况
- UI-DBP-031 - 活动验证
- UI-PRR-001 - 模拟单击
- UI-PRR-002 - 模拟键入
- UI-PRR-003 - 打开应用程序误用
- UI-PRR-004 - 硬编码延迟
- UI-REL-001 - 选取器中的大 IDX
- UI-SEC-004 - 选取器电子邮件数据
- UI-SEC-010 - 应用程序/Url 限制
- UI-USG-011 - 不允许的属性
- UX-SEC-010 - 应用程序/Url 限制
- UX-DBP-029 - 使用不安全的密码
- UI-PST-001 - 项目设置中的审核日志级别
- UiPath 浏览器迁移工具
- 剪切区域
- 计算机视觉录制器
- 活动索引
- 激活
- 锚点基准
- 附加浏览器
- 附加窗口
- 阻止用户输入
- 标注
- 选中
- 单击
- 单击图像
- 单击图像触发器
- 单击 OCR 文本
- 单击文本
- 单击触发器
- 关闭应用程序
- 关闭选项卡
- 关闭窗口
- 上下文感知锚点
- 复制选定文本
- 元素属性更改触发器
- 存在元素
- 元素作用域
- 元素状态更改触发器
- 导出用户界面树
- 提取结构化数据
- 查找子元素
- 查找元素
- 查找图像
- 查找图像匹配项
- 查找 OCR 文本位置
- 查找相对元素
- 查找文本位置
- 获取活动窗口
- 获取上级
- 获取属性
- 获取事件信息
- 从剪贴板获取
- 获取全文
- 获取 OCR 文本
- 获取密码
- 获取位置
- 获取源元素
- 获取文本
- 获取可见文本
- 返回
- 前往
- 转至主页
- Google Cloud Vision OCR
- 隐藏窗口
- 高亮显示
- 热键触发器
- 悬停
- 悬停在图像上方
- 悬停在 OCR 文本上方
- 悬停文本
- 存在图像
- 在屏幕上指定
- 注入 .NET 代码
- 插入 Js 脚本
- 调用 ActiveX 方法
- 按键触发器
- 加载图像
- 最大化窗口
- Microsoft Azure 计算机视觉 OCR
- Microsoft OCR
- Microsoft Project Oxford Online OCR
- 最小化窗口
- 监控事件
- 鼠标触发器
- 移动窗口
- 导航至
- 存在 OCR 文本
- 在元素出现时
- 在元素消失时
- 在图像出现时
- 在图像消失时
- 打开应用程序
- 打开浏览器
- 刷新浏览器
- 重播用户事件
- 还原窗口
- 保存图像
- 选择项目
- 选择多个项目
- 发送热键
- 设置剪切区域
- 设置焦点
- 设置文本
- 设置为剪贴板
- 设置网页属性
- 显示窗口
- 启动进程
- 系统触发器
- 截取屏幕截图
- Tesseract OCR
- 存在文本
- 工具提示
- 键入
- 输入安全文本
- 使用前台
- 等待属性
- 等待元素消失
- 等待图像消失
- Computer Vision Local Server
- 移动自动化
- 终端

用户界面自动化活动
故障排除场景
如果遇到问题,请考虑以下故障排除方案:
移动设备自动化
以下主题描述了移动设备自动化的问题及其相应的解决方法。
生成错误的工作流和活动
Description: The workflow in Studio throws unexpected errors, and the activity packages don't display the versions installed.
Cause: Inside your project, the major version of the UI.Automation activity package doesn't match the major version of the Mobile.Automation activity package. For example, the major version of the UI.Automation package installed is 22.10.x, and the major version of the Mobile.Automation package installed is 22.4.x.
Remedy: Make sure that the major versions of the UI.Automation and Mobile.Automation activity packages, installed in your project, match. For example, pair UI.Automation.Activities version 22.10.x only with Mobile.Automation.Activities version 22.10.x.
Always use the latest available patches for the UI.Automation and Mobile.Automation activity packages. For example, if you have UI.Automation or Mobile.Automation 22.10 installed, then download the latest available patches for 22.10.
未找到 wd/hub/ 会话的路由
Condition: When using Appium 2.0.
Description: No route found for /wd/hub/session.
Remedy: Manually add the following parameter before starting the Appium session: --base-path /wd/hub.
所有非标准功能都需要供应商前缀
Condition: When using Appium 2.0.
Description: All non-standard capabilities should have a vendor prefix.
Remedy: Manually add the appium: prefix for all capabilities, as follows:
- 在命令提示符或终端中,输入
--default-capabilities "{\"appium:systemPort\": 8201}"而不是--default-capabilities "{\"systemPort\": 8201}"}。 - In the Add a device tab from Mobile Device Manager, manually add the
appium:prefix before the name of any additional desired capability.
自动化名称不能为空
Condition: When using Appium 2.0.
Description: The automationName capability can't be blank.
Remedy: Add appium: as a prefix. For example, appium:automationName.
找不到已安装的驱动程序
Condition: When using Appium 2.0.
Description: Could not find the installed driver to support given caps.
Appium 2.0 doesn't automatically install the required drivers. You have to download them separately.
Remedy: Install the required driver for your platform.
- 对于 Android 设备,请使用
appium driver install uiautomator2命令安装uiautomator2驱动程序。 - 对于 iOS 设备,请使用
appium driver install xcuitest命令来安装xcuitest驱动程序。
Android
以下主题描述了 Android 设备的问题及其相应的解决方法。
由于功能 InvalidArgumentException连接失败
说明:本地设备和应用程序之间的连接可能会由于功能的预期格式与InvalidArgumentException存在差异而失败。当功能以字符串形式输入,而 Appium 需要一个布尔值时,就会出现此问题。指示性错误消息包括:
Failed to create session.
A new session could not be created.
Details: io.appium.uiautomator2.common.exceptions.InvalidArgumentException:
Invalid '<capability name>' setting value type.
Got java.lang.String. Expected: java.lang.Boolean
Failed to create session.
A new session could not be created.
Details: io.appium.uiautomator2.common.exceptions.InvalidArgumentException:
Invalid '<capability name>' setting value type.
Got java.lang.String. Expected: java.lang.Boolean
补救措施:从本地设备卸载以下应用程序:
io.appium.uiautomator2.serverio.appium.uiautomator2.server.test
活动由于以下原因失败 WebDriverException
说明:运行自动化 Android 设备的移动自动化工作流可能会导致WebDriverException 。此错误通常显示为Parameters were incorrect. We wanted {\"required\":[\"text\"]} and you sent [\"value\"]", "FaultCode":"WebDriverException"} 。
补救措施:卸载当前版本的 UiAutomator 2。然后按照给定顺序使用以下命令安装更新版本:
appium driver uninstall uiautomator2appium driver install uiautomator2@2.29.0,其中2.29.0是您要安装的版本。您可以将其替换为任何可用版本。
由于代理原因,Appium 安装失败
说明:运行npm install -g appium (适用于Appium 1.x )或npm install -g appium@next (适用于Appium 2.0 )命令失败,因为您正在代理后面运行。错误将引发以下消息:
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly.
See: 'npm help config'
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly.
See: 'npm help config'
补救措施:配置 npm(节点包管理器)以使用您的代理。请按照以下步骤操作:
- 获取您的代理服务器地址和端口号:
-
转到“Internet 选项” 。
-
选择“连接”选项卡。
-
选择“局域网设置” ,然后复制“地址”和“端口”字段中的内容。

-
- 返回到Node.js命令提示符,然后运行采用以下格式的命令:
- 对于 HTTP 代理:
npm config set http://your_proxy_address:your_port_number。 - 对于 HTTPS 代理:
npm config set https://your_proxy_address:your_port_number。
- 对于 HTTP 代理:
- 再次运行
npm install -g appium(适用于Appium 1.x )或npm install -g appium@next(适用于Appium 2.0 )命令。
无法访问所提供的网页上下文
说明:无法访问提供的 Web 上下文。请确保 Android WebView 可调试。有关访问网页上下文的更多信息,请访问远程调试 WebView。
Remedies:
- 在无法识别的网页上下文中将WebView 用作原生选取器。
- 如果选取器适用于网页应用程序,但不适用于原生应用程序,则该应用程序不会启用调试 WebView。在此情况下,请参阅远程调试 Android WebView 入门指南和远程调试 WebView 。
设备未授权
Description: Device not authorized.
Remedy: Take the following steps:
- 使用
adb devices命令检查现有的设备。 - Revoke Debugging on phone.
- Restart the ADB server, by using the following commands, in this order:
adb kill-server, and thenadb start-server. - 重新连接设备,并确认您同意该设备上的连接。
从启动屏幕启动时的浏览器自动化
说明:Android 设备启动浏览器自动化而非给定应用程序,从而导致错误。
Remedy: Start with a web browser instead.
Android 应用程序无法启动
Description: the Android app that you created doesn't launch in Mobile Device Manager.
Remedy:
- Hover over the application and click Edit.
- Add information about the app inside the App package and App activity fields.
iOS
以下主题描述了 iOS 设备的问题及其相应的解决方法。
无法在 iOS 13 上单击 WebView 元素
说明:单击 WebView 元素时,选取器不起作用,您无法自动化该元素。
补救措施:使用装有最新版本 iOS 和 Appium 2 的模拟器。
iOS 物理设备无法启动
Description: iOS physical device fails to start.
Remedy: Take the following steps:
- 确保您的设备信任该证书。在您的设备上,前往“设置” > “通用” > “配置文件与设备管理” ,点击电子邮件条目(例如Apple 开发: username@email.com )、然后信任该证书。如果设备使用的是您的公司帐户,则不需要此操作。
- 如果收到无法访问端口 8100 的错误,请关闭 Appium (
ctrl + c),然后重新启动。 - 如果您收到其他错误,请考虑查看 Appium XCUITest 驱动程序真实设备。
iOS 16.0 设备无法启动
Description: iOS 16.0 device fails to start or connect.
补救措施 :安装并使用 Appium 2.0 ,而不是 Appium 1 。有关安装和管理 Appium 2.0 的更多信息,请查看 本地 iOS 设备先决条件 部分。
iOS 12.4.5 故障
Description: iOS 12.4.5 doesn't work as expected while paired with Appium 1.22.3.
Cause: This is caused by an issue with Appium.
Remedy: Choose one of the options below:
- 使用较低版本的 Appium,例如 1.17.0。
这可能会导致最新版本的 XCode 出现问题,并且可能无法在 macOS 蒙特利 上按预期工作。
- 将设备升级到等于或高于 iOS 14 的版本。