订阅

UiPath Studio

UiPath Studio 指南

用户界面探测器

用户界面探测器是一个高级工具,使您可以为特定用户界面元素创建一个自定义选取器。它是独立工具,可以从 Automation Cloud 实例中的资源中心下载,也可以从 Studio 下载(仅限将 UiPath.UIAutomation.Activities 包作为项目的依赖项安装时)。

Using UI Explorer as a standalone tool does not require you to install Studio. This comes in handy when you want to make sure that an application can be automated with selectors. It enables you to simply inspect elements without building a process. The standalone package also contains the SetupExtensions utility, thus making it possible to install browser extensions and the JavaBridge to inspect elements across all your automation needs.

要打开“用户界面探测器”窗口,请单击“设计”选项卡中“选取器”部分中的按钮,或在指定目标用户界面元素后,单击“目标”和“锚点”属性的所有选取器的选择屏幕中的高级编辑器中的按钮。

📘

备注:

如果您没有将 UiPath.UIAutomation.Activities 包安装为当前项目的依赖项,那么功能区中不会显示用户界面探测器。

Alternatively, you can launch the UI Explorer by navigating to Home (Studio Backstage View) > Tools page > Apps.. UI Explorer from the context menu uses the UI automation libraries shipped with the current version of Studio.

📘

备注:

当前使用的 UIAutomation 包版本显示在您打开的用户界面探测器的右下角。此版本各有不同,因为从“工具”页面启动用户界面探测器使用的是您正在使用的 Studio 版本附带的默认用户界面自动化版本,而从功能区打开用户界面探测器则是使用已经作为当前项目的依赖项安装的版本。

为确保选择最佳选取器,请记住:

  • 添加或删除属性
  • 添加父项或子项标签
  • 使用通配符来替换变化值

用户界面探测器窗口字段说明

Field

Description

Validate

The button shows the status of the selector by checking the validity of the selector definition and the visibility of the target element on the screen.
The Validate button has three states:
image alt textimage alt text Selector is being validated
image alt textimage alt text Valid selector
image alt textimage alt text Invalid selector
image alt textimage alt text Modified selector, revalidate

Indicate Element
image alt textimage alt text

Indicates a new UI element to replace the previous one.

Indicate Anchor
image alt textimage alt text

Enables you to choose an anchor relative to the target UI element.

Repair
image alt textimage alt text

Enables you to re-indicate the same target UI element and repair the selector. This operation does not completely replace the previous selector. The button is available only when the selector is invalid.

Highlight
image alt textimage alt text

Brings the target element in the foreground. The highlight stays on until it's switched off. The button is enabled only if the selector is valid.

Options
image alt textimage alt text

Contains several options:
UI Frameworks - Changes the technology used to determine UI elements and their selectors. The following options are available:
Default – UiPath proprietary method. Usually works fine with all types of user interfaces.
Active Accessibility – an earlier solution from Microsoft for making apps accessible. It is recommended that you use this option with legacy software, when the Default one does not work.
UI Automation – the improved accessibility model from Microsoft. It is recommended that you use this option with newer apps, when the Default one does not work.
Click here to read more about Active Accessibility and UI Automation.
Delayed Restore - Enabled by default. Delay restoring the UiExplorer window until after the selector data is loaded. Use this option when indicating UI elements that auto-close on focus lost, such as drop-downs or overlays.
Trigger Selector - Ensures the uniqueness of a UI element within its parent while increasing its monitoring accuracy. Use this option when generating selectors for trigger activities.

可视化树面板

显示用户界面层次结构的树,通过单击每个节点前面的箭头,用于在其中导航。

默认情况下,当您第一次打开“用户界面探测器”时,此面板中会显示所有打开的应用程序并以字母顺序排列。

双击树中的用户界面元素(或右击并选择“设置为目标元素”),填充“选取器编辑器”、“选取器属性”和“属性探测器”面板。

Field

Description

Highlight
image alt textimage alt text

Highlights the selected element from the Visual Tree in real time. The highlight stays on until it's switched off.

Show Search Options
image alt textimage alt text

Displays the search box and search filter options.

Search Box

Enables you to look for a specific string. If an exact match is not found, nodes containing the nearest match are displayed.
Wildcards are supported.
Depending on the attribute selected from the Search by drop-down list, the search can be case sensitive.
Note: The search only looks for matches in the tree structure under the selected UI object.

Search by

Filters your search to a selected attribute or a selector. The contents of this drop-down list change according to the selected UI element.
Note: If Search by is set to Selector, you can only input one node in the <attribute name1='value1' ... /> format.

Children Only

Limit your search to the first level children of the selected node. By default, this check box is not selected.

选取器编辑器面板

显示指定用户界面对象的选取器,使您能够对其进行自定义。

面板的底部显示了必须在项目中使用的实际 XML 片段。找到所需的选取器后,可以从这里复制,然后将其粘贴到活动的“属性”面板中的“选取器”字段中。

此面板的顶部用于查看选取器中的所有节点,并通过清除前面的复选框来清除不必要的节点。当启用或禁用属性或编辑底部面板中的选取器时,选取器节点列表中的元素将变为活动元素。一次只能有一个节点处于活动状态。

如果在此处选择节点,那么将在“选取器属性”和“属性探测器”面板中显示其属性。

也可借助变量来编辑选取器;您可以使用 CTRL+K 热键在选取器本身中创建变量,或通过 CTRL+Space 组合指定已创建的变量。通过使用 CTRL+K 热键,您可以为变量指定值和名称。请注意,只能使用 string 变量。

选取器属性面板

显示选定节点的所有可用属性(来自“选取器编辑器”面板)。

您可以通过选中或清除每个属性前面的复选框来添加或消除某些节点属性。

此外,您可以更改每个属性的值,但只有当新的选取器指向最初选定的用户界面对象时,才会保留此修改。

属性探测器面板

显示指定用户界面对象可以具有的所有属性,包括选取器中没有出现过的属性。这些属性无法更改。

约一个月前更新


用户界面探测器


建议的编辑仅限用于 API 参考页面

您只能建议对 Markdown 正文内容进行编辑,而不能建议对 API 规范进行编辑。