- 发行说明
- 入门指南
- 设置和配置
- 自动化项目
- 依赖项
- 工作流类型
- 文件比较
- 自动化最佳实践
- 源代码控件集成
- 调试
- 诊断工具
- 工作流分析器
- 变量
- 参数
- 导入的命名空间
- 基于触发器的 Attended 自动化
- 控制流程
- 对象存储库
- 日志记录
- ScreenScrapeJavaSupport 工具
- Studio 测试
- 扩展程序
- 故障排除
本页介绍了 UiPath Chrome 扩展程序可能无法正常工作的常见原因,以及针对这些问题的解决方案。
请注意,目前可以在单个 Chrome 窗口中通过 Chrome 扩展程序实现浏览器自动化。
您需要使用版本最低为 64 的 Google Chrome 才能进行浏览器自动化。
检查 Chrome 扩展程序是否已安装并启用
-
在 Google Chrome 中,导航到
chrome://extensions/。 -
Make sure the extension is installed and enabled, as explained here.
-
If the extension was installed correctly but does not appear in Chrome, check if there are Group Policies that affect the extension, as explained here.
备注:Selecting the Developer mode check box at the top of the
chrome://extensions/page displays the Update button on the extension Details page.
检查 ChromeNativeMessaging.exe 是否正在运行
ChromeNativeMessaging.exe 支持 UiPath Chrome 扩展程序与 UiPath Studio/UiPath Robot 之间的通信。
-
打开 Chrome。
-
打开任务管理器。
-
检查
ChromeNativeMessaging.exe进程是否正在运行: -
如果该进程未运行:
- Make sure the extension is installed. For more information, check the installation methods described in the Extension for Chrome page.
- Check if there are Group Policies affecting
ChromeNativeMessaging.exe. See Group Policies for more information. - Check if ComSpec variable is defined correctly.
检查 ComSpec 变量是否已正确定义
描述
ChromeNativeMessaging.exe 进程在当前用户下运行,并使用 cmd.exe 启动浏览器。
如果 ComSpec 环境变量缺失或具有无效值,则 Google Chrome 无法启动 ChromeNativeMessaging.exe。
此外,管理员可以为某些用户禁用命令提示符,或将其配置为始终以高权限运行。
解决方案
解决方案是为 ComSpec 环境变量手动添加正确的值。此变量在 Windows 安装时设置,其值应为 %SystemRoot%\system32\cmd.exe。
其他解决方法
如果 ComSpec 环境变量设置正确,但问题仍然存在,则用户可能没有运行命令提示符的权限。在这种情况下,ChromeNativeMessaging.exe 流程无法通过在当前用户下运行的 cmd.exe 启动。
Starting with Chromium 120.0.6090+, a NativeHostsExecutablesLaunchDirectlyGroup Policy allows admins to turn this on for users in restricted environments (Cloud PCs that forbid cmd.exe, for example).
启用对文件 URL 和隐身模式的访问权限
默认情况下,该扩展程序未被授予访问文件 URL 或隐身模式的权限。要启用这些权限:
-
在 Google Chrome 中,导航到
chrome://extensions/。Chrome 扩展程序页面随即显示。 -
导航到 UiPath 网页自动化扩展程序,然后单击“详细信息”按钮。系统将显示“UiPath 网页自动化”详细信息页面。
-
确保选中了“允许匿名”和“允许访问文件 URL”选项。
多个浏览器配置文件
具有多个用户配置文件的多个 Chrome 实例
UiPath Chrome 扩展程序不支持同时自动化使用多个用户配置文件运行的多个浏览器实例。因此,浏览器自动化要求您关闭 Chrome 的所有活动实例,并使用单个用户配置文件重新启动浏览器。
停止所有 Chrome 实例
在某些情况下,Chrome 后台进程会阻止其完全关闭,即使浏览器实例不可见,这也会干扰自动化。
我们建议通过右键单击系统托盘中的 Chrome 图标,然后选择“退出”来关闭 Chrome。这样可以确保后台不再使用其他用户配置文件。
Group Policy conflict
描述
使用组策略安装适用于 Chrome 的 UiPath 扩展程序时,系统会在计算机级别更新“扩展程序安装强制列表”。
如果也在用户级别定义或使用 Chrome 云策略定义 ExtensionInstallForcelist,则可能会导致冲突。
由于计算机级别优先,因此将卸载在用户/云级别设置的扩展程序。
要确认这一点,请在 chrome://policy 中检查“扩展程序安装强制列表”下是否显示此警告:
This policy is working as intended but a conflicting value is set elsewhere and is overridden by this policy.
解决方案
要解决此冲突,请执行以下步骤:
-
使用
NativeHostOnly安装方法安装 UiPath Chrome 扩展程序。此安装方法可实现扩展程序与 Studio/Robot 之间的通信。
它不会对组策略进行任何更改。
To use this installation method add
CHROME_INSTALL_TYPE=NativeHostOnlyto the installation command for UiPathStudio.msi. Example:UiPathStudio.msi ADDLOCAL=DesktopFeature,Studio,Robot,RegisterService,ChromeExtension CHROME_INSTALL_TYPE=NativeHostOnly. -
在“扩展程序安装强制列表”策略中,添加以下值:
-
对于在线组策略安装方法(安装 Chrome 网上应用店扩展程序):
kmejkhcmhgilmppjodlgaklnmdmmhhcl;https://clients2.google.com/service/update2/crx -
For the Group Policy Offlineinstallation method (that installs the self-hosted extension):
ndmegdjihnhfmljjoaiimbipfhodnbgf;file:///C:/ProgramData/UiPath/UiPath.Common/ChromeExtension_SelfHosted/extension_manifest_chrome.xml
-
-
In the NativeMessagingAllowList policy, add the value:
com.uipath.chromenativemsg_v2.
特定于 MV3 扩展程序的已知问题
在特定网页元素上使用“模拟”的“单击”活动失败
The Click activity with the Simulate input method no longer works on HTML elements that have a click handler with javascript: URI.
在这种情况下,模拟点击将不会生效,也不会报告任何错误。
这已报告为 Chromium 错误。此问题非常罕见,因为很少有 HTML 元素在此表单中具有单击处理程序。
解决方法
此问题有两种解决方法:
- Identify the failing Click activity in your workflow and change the input method from Simulate to any other input method (Chromium API, Hardware Events, Window Messages).
- 升级到 UiPath.UIAutomation.Activities 包 v22.12 或更高版本,并使用“项目设置”中的“启用使用 MV3 扩展程序进行模拟的解决方法”选项。
“开发者工具可用性”组策略值必须设置为 1
开发者工具可用性具有以下可能的值:
- 0 = 不允许在企业策略安装的扩展程序上使用开发者工具,允许在其他上下文中使用开发者工具
- 1 = 允许使用开发者工具
- 2 = 禁止使用开发者工具
If the UiPath Extension for Chrome is installed using Group Policy, then the DeveloperToolsAvailability must be set to 1 to enable the full functionality of the extension.
安装扩展程序时,系统会自动正确设置此值,但如果系统管理员为此策略设置了其他值,则系统会覆盖此值。
“开发者工具可用性”的其他值会导致下面列出的问题。
如果 DeveloperToolsAvailability 设置为 0,则:
- UiPath Chrome 扩展程序 v22.4 根本无法使用此限制。请考虑升级到随 UiPathStudio.msi 2022.4.4 提供的扩展程序的 v22.10。
- UiPath Chrome 扩展程序 v22.10 将仅限使用 LTS 版本的 UIAutomation(19.10.x、20.10.x、21.10.x、22.4.x)
InjectJS活动将不起作用。
如果 DeveloperToolsAvailability 设置为 2,则:
DeveloperToolsAvailability=0中的所有限制均适用ChromiumAPI输入方法将不起作用。
UiPath 网页自动化浏览器窗口显示警告
如果无法启动 ChromeNativeMessaging.exe,UiPath 网页自动化浏览器窗口将显示以下警告:Cannot communicate with UiPath Platform The native part of the extension is not configured correctly.
从 UiPath Studio 中重新安装扩展程序。
无法再使用“注入 JS 脚本”活动来访问页面变量和代码
默认情况下,“注入 Js 脚本”活动不能再用于访问页面变量,例如jQuery $,或与页面代码交互(例如,window.alert)。 “注入 Js 脚本”活动不会报告错误,但脚本将无法执行,并且将在浏览器开发者工具 (F12) 中报告以下错误:Refused to execute inline script because it violates the following Content Security Policy directive。
这是 MV3 平台引入的限制。
要解决此问题,请从“注入 JS 脚本”活动中选择“执行环境 - 页面”选项。
从 UiPath.UIAutomation.Activities v22.12.0-preview 开始提供此属性。
Your existing JavaScript code doesn't require any changes, and by using the Execution world - Page option it will work for both MV2 and MV3 extensions.
“打开浏览器”活动的超时时间不足
对于 MV3 扩展程序,浏览器将在加载网页的稍后加载扩展程序。这意味着,在速度较慢的计算机上, UiPath.UiAutomation.Activities 22.10 或更低版本中的“打开浏览器”活动可能会在扩展程序启动前达到 20 秒的内部超时时间。
从 v22.12.0 预览版开始,“打开浏览器”活动的内部超时已从 20 秒增加到 60 秒。
由于您可能需要为浏览器启动设置更长的超时时间,因此现在可以通过“使用应用程序/浏览器”和“打开浏览器”活动对其进行配置。已添加以下项目设置:
- 用户界面自动化传统 → 浏览器 → 打开浏览器超时 (秒)
- UI Automation Modern→ Application/Browser → Open browser timeout (seconds)
此外,您可以通过 UIPATH_OPEN_BROWSER_TIMEOUT_SECONDS 环境变量配置超时。 例如,将 UIPATH_OPEN_BROWSER_TIMEOUT_SECONDS=120 设置为使用 120 秒作为活动的超时时间。
- 检查 Chrome 扩展程序是否已安装并启用
- 检查 ChromeNativeMessaging.exe 是否正在运行
- 检查 ComSpec 变量是否已正确定义
- 描述
- 解决方案
- 其他解决方法
- 启用对文件 URL 和隐身模式的访问权限
- 多个浏览器配置文件
- 具有多个用户配置文件的多个 Chrome 实例
- 停止所有 Chrome 实例
- Group Policy conflict
- 描述
- 解决方案
- 特定于 MV3 扩展程序的已知问题
- 在特定网页元素上使用“模拟”的“单击”活动失败
- “开发者工具可用性”组策略值必须设置为 1
- UiPath 网页自动化浏览器窗口显示警告
- 无法再使用“注入 JS 脚本”活动来访问页面变量和代码
- “打开浏览器”活动的超时时间不足