- 入门指南
- 设置和配置
- 自动化项目
- 依赖项
- 工作流类型
- 控制流程
- 文件比较
- 自动化最佳实践
- 源代码控件集成
- 调试
- 日志记录
- 诊断工具
- 工作流分析器
- 变量
- 参数
- 导入的命名空间
- 编码自动化
- 基于触发器的 Attended 自动化
- 对象存储库
- ScreenScrapeJavaSupport 工具
- 扩展程序
- Studio 测试
- 故障排除
Studio 用户指南
此扩展可帮助您在 Mac 上的 Google Chrome 中创建浏览器自动化。
安装方法
UiPath Chrome 扩展程序可以通过多种方式安装,具体取决于允许的用户交互程度。
扩展程序可以为特定用户安装,或按计算机(面向所有用户)安装。这两种安装类型之间的唯一区别在于配置文件的位置。
| 安装类型 | 配置文件位置 |
|---|---|
| 按用户 | ~{userId}/Library/Application Support/Google/Chrome/External Extensions/~{userId}/Library/Application Support/Google/Chrome/NativeMessagingHosts/将 {userId} 替换为用户的用户名。 |
| 每台计算机 | /Library/Application Support/Google/Chrome/External Extensions//Library/Google/Chrome/NativeMessagingHosts/ |
从 UiPath Assistant 安装
只要已安装 UiPath Assistant,只需点击几下,即可使用 UiPath Assistant 进行安装,无需进行额外配置。此方法安装的是仅针对当前用户发布到网上应用店的最新扩展程序版本。
-
访问 UiPath Assistant。
-
选择帐户图标。
-
选择“首选项”。
-
转到 UiPath 扩展程序。
-
选择“为 Google Chrome 安装”。
-
在 Google Chrome 确认弹出窗口中选择“启用扩展程序”。
结果
The extension is installed and enabled.
从终端安装(通过 UiPath.ExtensionControl.Portable.dll)
UiPath 提供用于管理扩展程序安装的工具:UiPath.ExtensionControl.Portable.dll。此工具将随 UiPath Assistant 一起分发,同时还将提供运行扩展程序所需的其他文件。
先决条件
- 始终使用
/Applications目录中的UiPath.ExtensionControl.Portable.dll文件运行命令,因为对来自其他位置的二进制文件执行操作时,macOS 比较敏感。 - 运行命令之前,关闭所有 Chrome 窗口。
您可以使用以下任一安装方法:
当前用户
此方法仅为当前用户安装扩展程序。它会创建或更新 Chrome 用于检测扩展程序的 JSON 配置文件。这些文件定义扩展程序 ID、更新 URL 以及原生消息传递主机的路径。
- 添加针对特定扩展程序版本的
--ext-id={extensionId}选项。将{extensionId}替换为所需扩展程序的 ID。有关可用 ID 列表,请参阅“Studio - Chrome 扩展程序列表”。 - 命令的
--ext-id={extensionId}部分为可选部分。如果省略,则将安装已发布到网上应用店的最新版本扩展程序。
安装步骤
-
打开终端并运行以下命令:
dotnet /Applications/UiPath\ Assistant.app/Contents/Extensions/UiPath.ExtensionControl.Portable.dll install chromedotnet /Applications/UiPath\ Assistant.app/Contents/Extensions/UiPath.ExtensionControl.Portable.dll install chrome -
在 Google Chrome 确认弹出窗口中选择“启用扩展程序”。
结果
The extension is installed and enabled.
所有用户
此方法会为计算机上的所有用户安装扩展程序。此方法会创建或更新 Chrome 用于检测扩展程序的 JSON 配置文件,运行方式与“当前用户”方法类似。区别在于文件位置:此方法会将配置文件写入系统级位置,而“当前用户”方法会将配置文件写入用户专属位置。
- 运行此命令需要使用
sudo,因为命令会更新系统配置文件。 - 添加针对特定扩展程序版本的
--ext-id={extensionId}选项。将{extensionId}替换为所需扩展程序的 ID。有关可用 ID 列表,请参阅“Studio - Chrome 扩展程序列表”。 - 命令的
--ext-id={extensionId}部分为可选部分。如果省略,则将安装已发布到网上应用店的最新版本扩展程序。
安装步骤
-
打开终端并运行以下命令:
sudo dotnet /Applications/UiPath\ Assistant.app/Contents/Extensions/UiPath.ExtensionControl.Portable.dll install chrome --scope=machinesudo dotnet /Applications/UiPath\ Assistant.app/Contents/Extensions/UiPath.ExtensionControl.Portable.dll install chrome --scope=machine -
在 Google Chrome 确认弹出窗口中选择“启用扩展程序”。
结果
The extension is installed and enabled.
在线组策略
使用此方法,无需在首次启动 Chrome 后执行手动启用扩展程序的步骤。这是因为它依赖于 MDM(移动设备管理)工具部署的配置配置文件。
配置文件会设置 ExtensionInstallForcelist 策略。此策略能够确保扩展程序已启用,且无法手动禁用。
此过程与此处所述的 Windows 组策略在线安装方法类似:Studio - Chrome 扩展程序。
要安装配置文件(.mobileconfig 文件),计算机上必须有 MDM 应用程序,并且必须注册计算机才能进行管理。
MDM 的示例包括:
如果设备已注册在 MDM 解决方案中,请确保该配置不会被通过 MDM 推送的配置更新覆盖。为避免此情况,请直接通过 MDM 部署配置文件。配置文件应包含与以下示例类似的设置:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<!-- This policy ensures that the {extensionId} is enabled -->
<key>ExtensionInstallForcelist</key>
<array>
<string>{extensionId};https://clients2.google.com/service/update2/crx</string>
</array>
<!-- The policies below are not mandatory, but they are useful in some systems,
depending on the already present configuration -->
<!-- This policy enables the Developer mode in chrome://extensions -->
<key>DeveloperToolsAvailability</key>
<integer>1</integer>
<key>BlockExternalExtensions</key>
<false/>
<key>ExtensionAllowedTypes</key>
<array>
<string>extension</string>
</array>
<key>NativeMessagingUserLevelHosts</key>
<true/>
<key>NativeMessagingAllowlist</key>
<array>
<string>com.uipath.portable_host</string>
</array>
<key>PayloadDisplayName</key>
<string>Google Chrome</string>
<key>PayloadIdentifier</key>
<string>com.google.Chrome.2C2280F4-2955-49E9-8161-A599B9BB6685</string>
<key>PayloadType</key>
<string>com.google.Chrome</string>
<key>PayloadUUID</key>
<string>2C2280F4-2955-49E9-8161-A599B9BB6685</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>UiPath Studio Web Automation Chrome Extension Installation</string>
<key>PayloadIdentifier</key>
<string>com.uipath.chrome.extension.A64BC628-4ECF-4A71-91D5-20D7C7475C38</string>
<key>PayloadOrganization</key>
<string>com.uipath</string>
<key>PayloadScope</key>
<string>System</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>A64BC628-4ECF-4A71-91D5-20D7C7475C38</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>TargetDeviceType</key>
<integer>5</integer>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<!-- This policy ensures that the {extensionId} is enabled -->
<key>ExtensionInstallForcelist</key>
<array>
<string>{extensionId};https://clients2.google.com/service/update2/crx</string>
</array>
<!-- The policies below are not mandatory, but they are useful in some systems,
depending on the already present configuration -->
<!-- This policy enables the Developer mode in chrome://extensions -->
<key>DeveloperToolsAvailability</key>
<integer>1</integer>
<key>BlockExternalExtensions</key>
<false/>
<key>ExtensionAllowedTypes</key>
<array>
<string>extension</string>
</array>
<key>NativeMessagingUserLevelHosts</key>
<true/>
<key>NativeMessagingAllowlist</key>
<array>
<string>com.uipath.portable_host</string>
</array>
<key>PayloadDisplayName</key>
<string>Google Chrome</string>
<key>PayloadIdentifier</key>
<string>com.google.Chrome.2C2280F4-2955-49E9-8161-A599B9BB6685</string>
<key>PayloadType</key>
<string>com.google.Chrome</string>
<key>PayloadUUID</key>
<string>2C2280F4-2955-49E9-8161-A599B9BB6685</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>UiPath Studio Web Automation Chrome Extension Installation</string>
<key>PayloadIdentifier</key>
<string>com.uipath.chrome.extension.A64BC628-4ECF-4A71-91D5-20D7C7475C38</string>
<key>PayloadOrganization</key>
<string>com.uipath</string>
<key>PayloadScope</key>
<string>System</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>A64BC628-4ECF-4A71-91D5-20D7C7475C38</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>TargetDeviceType</key>
<integer>5</integer>
</dict>
</plist>
如果设备未在 MDM 解决方案中注册,UiPath.ExtensionControl.Portable.dll 工具会在本地写入所需的配置,而不会被 MDM 应用的策略覆盖。这样,Chrome 就可以应用策略,并确保扩展程序在无需用户交互的情况下处于启用状态。
- 运行此命令需要使用
sudo,因为命令会更新系统配置文件。 - 使用
bypolicy选项,会自动将作用域设置为计算机。 - 发出此命令时可以使用
--scope=machine而非--scope=user,其作用是只为当前用户安装并自动启用扩展程序。不会为任何其他用户安装扩展程序。 - 添加针对特定扩展程序版本的
--ext-id={extensionId}选项。将{extensionId}替换为所需扩展程序的 ID。有关可用 ID 列表,请参阅“Studio - Chrome 扩展程序列表”。 - 命令的
--ext-id={extensionId}部分为可选部分。如果省略,则将安装已发布到网上应用店的最新版本扩展程序。
安装步骤
A. MDM-enrolled machine
-
打开终端并运行以下命令:如果将通过 MDM 推送的配置设置为覆盖现有值,则可以移除
bypolicy参数。sudo dotnet /Applications/UiPath\ Assistant.app/Contents/Extensions/UiPath.ExtensionControl.Portable.dll install chrome bypolicy --scope=machinesudo dotnet /Applications/UiPath\ Assistant.app/Contents/Extensions/UiPath.ExtensionControl.Portable.dll install chrome bypolicy --scope=machine -
新建
.mobileconfig文件,以配置所需的策略。.mobileconfig文件的内容应与上述内容大致相同。 -
使用 MDM 提供程序安装配置文件。
-
启动 Chrome。
-
设计和运行自动化。
结果
The extension is installed and enabled.
B. Not MDM-enrolled machine
-
打开终端并运行以下命令:
sudo dotnet /Applications/UiPath\ Assistant.app/Contents/Extensions/UiPath.ExtensionControl.Portable.dll install chrome bypolicy --scope=machinesudo dotnet /Applications/UiPath\ Assistant.app/Contents/Extensions/UiPath.ExtensionControl.Portable.dll install chrome bypolicy --scope=machine -
设计和运行自动化。
结果
The extension is installed and enabled.
离线组策略
UiPath.ExtensionControl.Portable.dll 无法单独执行此安装类型,因为它需要干预(无论是在本地计算机上还是在管理员计算机上)。
UiPath.ExtensionControl.Portable.dll 支持更新扩展程序与原生主机通信所需的配置文件。因此,如前所示,它可以用于按用户或按计算机安装扩展程序,但需要执行其他步骤以确保扩展程序已安装并启用。
配置文件会设置 ExtensionInstallForcelist 策略。此策略能够确保扩展程序已启用,且无法手动禁用。
此方法:
- 用于安装任何已发布到网上应用店或未发布的扩展程序。
- 在互联网访问受限(无法访问
https://clients2.google.com/service/update2/crx)的环境中非常有用。
配置文件应大致包含以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<!-- This policy ensures that the {extensionId} is enabled -->
<key>ExtensionInstallForcelist</key>
<array>
<string>{extensionId}</string>
</array>
<!-- The policies below are not mandatory, but they are useful in some systems,
depending on the already present configuration -->
<!-- This policy enables the Developer mode in chrome://extensions -->
<key>DeveloperToolsAvailability</key>
<integer>1</integer>
<key>BlockExternalExtensions</key>
<false/>
<key>ExtensionAllowedTypes</key>
<array>
<string>extension</string>
</array>
<key>NativeMessagingUserLevelHosts</key>
<true/>
<key>NativeMessagingAllowlist</key>
<array>
<string>com.uipath.portable_host</string>
</array>
<key>PayloadDisplayName</key>
<string>Google Chrome</string>
<key>PayloadIdentifier</key>
<string>com.google.Chrome.2C2280F4-2955-49E9-8161-A599B9BB6685</string>
<key>PayloadType</key>
<string>com.google.Chrome</string>
<key>PayloadUUID</key>
<string>2C2280F4-2955-49E9-8161-A599B9BB6685</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>UiPath Studio Web Automation Chrome Extension Installation</string>
<key>PayloadIdentifier</key>
<string>com.uipath.chrome.extension.A64BC628-4ECF-4A71-91D5-20D7C7475C38</string>
<key>PayloadOrganization</key>
<string>com.uipath</string>
<key>PayloadScope</key>
<string>System</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>A64BC628-4ECF-4A71-91D5-20D7C7475C38</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>TargetDeviceType</key>
<integer>5</integer>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<!-- This policy ensures that the {extensionId} is enabled -->
<key>ExtensionInstallForcelist</key>
<array>
<string>{extensionId}</string>
</array>
<!-- The policies below are not mandatory, but they are useful in some systems,
depending on the already present configuration -->
<!-- This policy enables the Developer mode in chrome://extensions -->
<key>DeveloperToolsAvailability</key>
<integer>1</integer>
<key>BlockExternalExtensions</key>
<false/>
<key>ExtensionAllowedTypes</key>
<array>
<string>extension</string>
</array>
<key>NativeMessagingUserLevelHosts</key>
<true/>
<key>NativeMessagingAllowlist</key>
<array>
<string>com.uipath.portable_host</string>
</array>
<key>PayloadDisplayName</key>
<string>Google Chrome</string>
<key>PayloadIdentifier</key>
<string>com.google.Chrome.2C2280F4-2955-49E9-8161-A599B9BB6685</string>
<key>PayloadType</key>
<string>com.google.Chrome</string>
<key>PayloadUUID</key>
<string>2C2280F4-2955-49E9-8161-A599B9BB6685</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>UiPath Studio Web Automation Chrome Extension Installation</string>
<key>PayloadIdentifier</key>
<string>com.uipath.chrome.extension.A64BC628-4ECF-4A71-91D5-20D7C7475C38</string>
<key>PayloadOrganization</key>
<string>com.uipath</string>
<key>PayloadScope</key>
<string>System</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>A64BC628-4ECF-4A71-91D5-20D7C7475C38</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>TargetDeviceType</key>
<integer>5</integer>
</dict>
</plist>
ExtensionInstallForcelist 字符串具有以下格式:
{extensionId}{extensionId};{urlWithThePathToTheUpdateManifestXmlFile}
{urlWithThePathToTheUpdateManifestXmlFile} 值必须替换为更新清单 XML 文件的 URL(https:// 或 file://)。此文件包含以下内容:
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='{extensionId}'>
<updatecheck
codebase='{crxUrl}'
version='{extensionVersion}' />
</app>
</gupdate>
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='{extensionId}'>
<updatecheck
codebase='{crxUrl}'
version='{extensionVersion}' />
</app>
</gupdate>
- 将
{extensionId}替换为扩展程序的 ID。 {crxUrl}必须替换为 CRX 的 URL(如果 CRX 托管在服务器上,则为https://,如果文件置于本地计算机上,则为file://)。- 必须将
{extensionVersion}替换为扩展程序的版本(类似于 24.10.3)。
安装步骤
步骤 1 和 2 在管理员计算机上执行。
-
如上所述创建配置文件。
-
使用 MDM 提供程序推送配置文件。
-
通过打开终端并运行以下命令,安装原生消息传递主机:
dotnet /Applications/UiPath\ Assistant.app/Contents/Extensions/UiPath.ExtensionControl.Portable.dll install chrome native-messaging-host-only --scope=machinedotnet /Applications/UiPath\ Assistant.app/Contents/Extensions/UiPath.ExtensionControl.Portable.dll install chrome native-messaging-host-only --scope=machine -
启动 Chrome。
-
设计和运行自动化。
结果
The extension is installed and enabled.
此方法依赖于 MDM(移动设备管理)工具部署的配置文件。配置文件会应用 ExtensionInstallForcelist 策略,确保扩展程序自动启用,且用户无法禁用。
此过程与此处所述的 Windows 组策略离线安装方法类似:Studio - Chrome 扩展程序。
卸载
从 UiPath Assistant 卸载
-
访问 UiPath Assistant。
-
转到 UiPath 扩展程序。
-
选择“为 Google Chrome 卸载”。
结果
扩展程序已卸载。
从终端卸载
无论采用哪种安装方法,您都可以通过运行以下命令,卸载 UiPath Chrome 扩展程序:
dotnet UiPath.ExtensionControl.Portable.dll cleanup chrome
dotnet UiPath.ExtensionControl.Portable.dll cleanup chrome
结果
扩展程序已卸载。
检查状态
要查看 Chrome 扩展程序的状态,请根据您的安装方法运行相应的终端命令:
- 当前用户
dotnet UiPath.ExtensionControl.Portable.dll status chromedotnet UiPath.ExtensionControl.Portable.dll status chrome - 所有用户
dotnet UiPath.ExtensionControl.Portable.dll status chrome --scope=machinedotnet UiPath.ExtensionControl.Portable.dll status chrome --scope=machine - 在线组策略
dotnet UiPath.ExtensionControl.Portable.dll status chrome bypolicy --scope=machinedotnet UiPath.ExtensionControl.Portable.dll status chrome bypolicy --scope=machine - 离线组策略
dotnet UiPath.ExtensionControl.Portable.dll status chrome native-messaging-host-only --scope=machinedotnet UiPath.ExtensionControl.Portable.dll status chrome native-messaging-host-only --scope=machine