- 发行说明
- 入门指南
- 设置和配置
- 自动化项目
- 依赖项
- 工作流类型
- 文件比较
- 自动化最佳实践
- 源代码控件集成
- 调试
- 诊断工具
- 工作流分析器
- 变量
- 参数
- 导入的命名空间
- 录制
- 用户界面元素
- 控制流程
- 选取器
- 对象存储库
- 数据抓取
- 图像与文本自动化
- Citrix 技术自动化
- RDP 自动化
- Salesforce 自动化
- SAP 自动化
- VMware Horizon 自动化
- 日志记录
- ScreenScrapeJavaSupport 工具
- Webdriver 协议
- Studio 测试
- 扩展程序
- 故障排除

Studio 用户指南
关于选取器
要自动执行用户界面中的特定操作,您需要与各种窗口、按钮、下拉列表以及许多其他元素交互。可以识别用户界面元素的一种方法是使用它们在屏幕上的位置,但这可能不可靠。
为了解决这个问题,Studio 使用了选取器。它们以 XML 片段的形式存储图形用户界面元素及其父元素的属性。
大多数情况下,选取器是由 Studio 自动生成的,并且不需要您额外输入,特别是当您尝试自动化的应用程序具有静态用户界面时。
然而,某些软件程序的布局会不断变化,且属性节点的值不稳定,例如某些网页应用程序。Studio 无法预测这些更改,因此,您可能必须手动生成一些选取器。
选取器具有以下结构:
<node_1/><node_2/>...<node_N/>
<node_1/><node_2/>...<node_N/>
最后一个节点表示您感兴趣的图形用户界面元素,而前面的所有节点都表示该元素的父元素。<node_1> 通常称为根节点,表示应用程序的顶部窗口。
每个节点都有一个或多个属性,可以帮助您正确识别所选应用程序的特定级别。
每个节点的格式如下:
<ui_system attr_name_1='attr_value_1' ... attr_name_N='attr_value_N'/>
<ui_system attr_name_1='attr_value_1' ... attr_name_N='attr_value_N'/>
每个属性都有一个赋值。重要的是选择具有常量值的属性。如果每次应用程序启动时,属性的值都会发生变化,则选取器将无法正确识别元素。
系统会在活动“属性”面板中的“输入”>“目标”>“选取器”下现实选取器。与图形元素相关的所有活动都具有此属性。
“选择选项”窗口用于选择和编辑目标。要访问此窗口,请在“工作流设计器”面板中单击“选项” 按钮,然后选择“在屏幕上指定目标”或“编辑目标”。
“选取器编辑器”窗口用于查看自动生成的选取器以及编辑该选取器及其属性。要访问此窗口,请使用省略号 按钮,该按钮位于“属性”面板中的“选取器”字段旁边。
选项 |
描述 |
---|---|
验证 |
该按钮通过检查选取器定义的有效性以及目标元素在屏幕上的可见性来显示选取器的状态。 验证按钮具有三种状态:
该按钮与用户界面探测器验证状态相关。 |
指出元素 |
指出一个新的用户界面元素以替换前一个。 |
修复 |
使您能够重新指定相同的目标用户界面元素并修复选取器。此操作并不完全替换以前的选取器。只有在选取器无效时,该按钮才可用。 |
高亮显示 |
将目标元素置于前台。高亮显示一直持续到该选项被单击禁用为止。仅当选取器有效时才会启用该按钮。 |
编辑属性 |
包含标识目标应用程序时所需的所有应用程序组件(窗口、按钮等)。该部分可以编辑。 |
编辑选取器 |
保存实际的选取器。该部分可以编辑。 |
在用户界面探测器中打开 |
启动用户界面探测器。该选项仅对有效的选取器启用。 |
下表列出了用于构建选取器和选取器功能的标签和属性之间的兼容性。
wnd
、ax
、java
和 sap
可用于不同用例:
- AX 选取器可用于所有类型的 macOS 桌面应用程序。
- SAP 选取器可用于 macOS 上的 SAP GUI for Java,需要启用脚本功能的 SAP 服务器。这些选取器对 SAP 应用程序最稳定,提供最全面的功能,例如提取表格数据。
- Java 选取器可用于 Java 应用程序。由于 SAP GUI for Java 也是一个基于 Java 的应用程序,因此可以使用 Java 选择策略从默认选取器切换,以获取 Java 选取器。
属性 |
模糊 |
正则表达式 |
区分大小写 | 操作系统 |
---|---|---|---|---|
app |
|
|
|
Windows macOS |
cls |
|
|
| Windows |
title |
|
|
|
Windows macOS |
aaname |
|
|
| Windows |
ctrlname (WinForms) |
|
|
| Windows |
ctrlid (WinForms) |
|
|
| Windows |
idx |
|
|
|
Windows macOS |
tid |
|
|
|
Windows macOS |
pid |
|
|
|
Windows macOS |
isremoteapp |
|
|
| Windows |
aastate |
|
|
| Windows |
角色 | macOS | |||
enabled | macOS | |||
focused | macOS | |||
已选定 | macOS | |||
已展开 | macOS | |||
sapClient (SAP) |
|
|
|
Windows macOS |
sapLanguage (SAP) |
|
|
|
Windows macOS |
sapProgram (SAP) |
|
|
|
Windows macOS |
sapScreen (SAP) |
|
|
|
Windows macOS |
sapSession (SAP) |
|
|
|
Windows macOS |
sapSysName (SAP) |
|
|
|
Windows macOS |
sap 系统编号 (SAP) |
|
|
|
Windows macOS |
sapSysSessionId (SAP) |
|
|
|
Windows macOS |
sapTransaction (SAP) |
|
|
|
Windows macOS |
sapUser (SAP) |
|
|
|
Windows macOS |
curlApplet(Curl) | Windows |
属性 |
模糊 |
正则表达式 |
区分大小写 | 操作系统 |
---|---|---|---|---|
url |
|
|
|
Windows macOS Linux |
htmlwindowname |
|
|
|
Windows macOS Linux |
title |
|
|
|
Windows macOS Linux |
class |
|
|
|
Windows macOS Linux |
app |
|
|
|
Windows macOS Linux |
idx |
|
|
|
Windows macOS Linux |
pid |
|
|
|
Windows macOS Linux |
tid |
|
|
|
Windows macOS Linux |
excludehwnd |
|
|
|
Windows macOS Linux |
bsid(浏览器会话 ID) |
|
|
|
Windows macOS Linux |
isremoteapp |
|
|
|
Windows macOS Linux |
tag 和 idx 属性使用字符串值。所有其他 WEBCTRL 属性都具有动态值。
属性 |
模糊 |
正则表达式 |
区分大小写 | 操作系统 |
---|---|---|---|---|
tag |
|
|
|
Windows macOS Linux |
idx |
|
|
|
Windows macOS Linux |
aaname |
|
|
|
Windows macOS Linux |
name |
|
|
|
Windows macOS Linux |
id |
|
|
|
Windows macOS Linux |
parentid |
|
|
|
Windows macOS Linux |
class |
|
|
|
Windows macOS Linux |
css-selector |
|
|
|
Windows macOS Linux |
innertext |
|
|
|
Windows macOS Linux |
visibleinnertext |
|
|
|
Windows macOS Linux |
isleaf |
|
|
|
Windows macOS Linux |
parentclass |
|
|
|
Windows macOS Linux |
parentname |
|
|
|
Windows macOS Linux |
src |
|
|
|
Windows macOS Linux |
href |
|
|
|
Windows macOS Linux |
tableCol |
|
|
|
Windows macOS Linux |
tableRow |
|
|
|
Windows macOS Linux |
colName |
|
|
|
Windows macOS Linux |
rowName |
|
|
|
Windows macOS Linux |
aria-label |
|
|
|
Windows macOS Linux |
aria-labelledby |
|
|
|
Windows macOS Linux |
属性 |
模糊 |
正则表达式 |
区分大小写 | 操作系统 |
---|---|---|---|---|
角色 |
|
|
| Windows |
name |
|
|
| Windows |
automationid |
|
|
| Windows |
labeledby |
|
|
| Windows |
aastate |
|
|
| Windows |
virtualname |
|
|
| Windows |
text |
|
|
| Windows |
rowName |
|
|
| Windows |
idx |
|
|
| Windows |
属性 |
模糊 |
正则表达式 |
区分大小写 | 操作系统 |
---|---|---|---|---|
accelkey(加速键) |
|
|
| Windows |
acskey(访问密钥) |
|
|
| Windows |
automationid |
|
|
| Windows |
cls |
|
|
| Windows |
helpText |
|
|
| Windows |
legacyAccHelp(旧版辅助功能帮助) |
|
|
| Windows |
enabled |
|
|
| Windows |
kbfocus(键盘是否可聚焦) |
|
|
| Windows |
ispwd(为密码) |
|
|
| Windows |
itemstatus |
|
|
| Windows |
itemtype |
|
|
| Windows |
rtid(运行时 ID) |
|
|
| Windows |
角色 |
|
|
| Windows |
name |
|
|
| Windows |
pid |
|
|
| Windows |
tableRow |
|
|
| Windows |
tableCol |
|
|
| Windows |
rowName |
|
|
| Windows |
colName |
|
|
| Windows |
idx |
|
|
| Windows |
属性 |
模糊 |
正则表达式 |
区分大小写 | 操作系统 |
---|---|---|---|---|
角色 |
|
|
|
Windows macOS |
name |
|
|
|
Windows macOS |
virtualname |
|
|
|
Windows macOS |
javastate |
|
|
|
Windows macOS |
tableRow |
|
|
|
Windows macOS |
tableCol |
|
|
|
Windows macOS |
rowName |
|
|
|
Windows macOS |
colName |
|
|
|
Windows macOS |
idx |
|
|
|
Windows macOS |
cls |
Windows macOS | |||
accessibleClass |
Windows macOS |
属性 |
模糊 |
正则表达式 |
区分大小写 | 操作系统 |
---|---|---|---|---|
id |
|
|
|
Windows macOS |
leafid “属性”面板未公开此属性,因其与“id”属性互斥。不过可以手动添加。 |
|
|
|
Windows macOS |
tableRow |
|
|
|
Windows macOS |
tableCol |
|
|
|
Windows macOS |
colName |
|
|
|
Windows macOS |
relpath |
|
|
|
Windows macOS |
itemId |
|
|
|
Windows macOS |
属性 | 模糊 | 正则表达式 | 区分大小写 | 操作系统 |
---|---|---|---|---|
角色 | macOS | |||
subrole | macOS | |||
name | macOS | |||
title | macOS | |||
标识符 | macOS | |||
文件名 | macOS | |||
url | macOS | |||
帮助 | macOS | |||
enabled | macOS | |||
focused | macOS | |||
已选定 | macOS | |||
已展开 | macOS | |||
idx | macOS |
属性 | 模糊 | 正则表达式 | 区分大小写 | 操作系统 |
---|---|---|---|---|
cls | Windows | |||
角色 | Windows | |||
text | Windows | |||
title | Windows | |||
tableRow | Windows | |||
tableCol | Windows | |||
colHeader | Windows | |||
idx | Windows |
属性 | 模糊 | 正则表达式 | 区分大小写 | 操作系统 |
---|---|---|---|---|
角色 | Windows | |||
name | Windows | |||
text | Windows | |||
idx | Windows |