- 发行说明
- 入门指南
- 设置和配置
- 自动化项目
- 依赖项
- 工作流类型
- 文件比较
- 自动化最佳实践
- 源代码控件集成
- 调试
- 诊断工具
- 工作流分析器
- 变量
- 参数
- 导入的命名空间
- 控制流程
- 对象存储库
- 日志记录
- ScreenScrapeJavaSupport 工具
- Studio 测试
- 扩展程序
- 故障排除
故障排除
本页介绍了可能导致 Edge 扩展程序无法正常工作的常见原因,以及针对这些问题的解决方案。
请查看以下页面:
- 无法与浏览器通信
- 系统已自动删除 Edge 扩展程序
- 扩展程序可能已损坏
- 检查是否已安装并启用 Microsoft Edge 扩展程序
- 检查 ChromeNativeMessaging.exe 是否正在运行
- 检查 ComSpec 变量是否已正确定义
- 启用对文件 URL 和 InPrivate 的访问权限
- 多个浏览器配置文件
- 组策略冲突
- 特定于 MV3 扩展程序的已知问题
检查是否已安装并启用 Microsoft Edge 扩展程序
- 在 Microsoft Edge 中,导航到
edge://extensions/。 - Make sure the extension is installed and enabled, as explained here.
- If the extension was installed correctly but does not appear in Microsoft Edge, check if there are Group Policies that affect the extension, as explained here.
检查 ChromeNativeMessaging.exe 是否正在运行
ChromeNativeMessaging.exe 支持 UiPath Edge 扩展程序与 UiPath Studio/UiPath Robot 之间的通信。
-
打开 Microsoft Edge。
-
打开任务管理器。
-
检查
ChromeNativeMessaging.exe进程是否正在运行: -
如果该进程未运行:
检查 ComSpec 变量是否已正确定义
描述
ChromeNativeMessaging.exe 进程在当前用户下运行,并使用 cmd.exe 启动浏览器。
如果 ComSpec 环境变量缺失或具有无效值,则 Microsoft Edge 无法启动 ChromeNativeMessaging.exe。
此外,管理员可以为某些用户禁用命令提示符,或将其配置为始终以高权限运行。
解决方案
解决方案是为 ComSpec 环境变量手动添加正确的值。此变量在 Windows 安装时设置,其值应为 %SystemRoot%\system32\cmd.exe。
其他解决方法
如果 ComSpec 环境变量设置正确,但问题仍然存在,则用户可能没有运行命令提示符的权限。在这种情况下,ChromeNativeMessaging.exe 流程无法通过在当前用户下运行的 cmd.exe 启动。
从 Chromium 120.0.6090+ 开始,NativeHostsExecutablesLaunchDirectly 组策略允许管理员为受限环境(例如,禁止 cmd.exe 的 Cloud PC)中的用户启用此功能。
启用对文件 URL 和 InPrivate 的访问权限
默认情况下,扩展程序无权访问文件 URL 或 InPrivate 模式。要启用这些,请执行以下操作:
-
在 Microsoft Edge 中,导航到
edge://extensions/。系统将显示 Microsoft Edge 扩展程序页面。 -
导航到 UiPath 浏览器自动化扩展程序,然后单击“详细信息”按钮。
-
确保选中了“允许 InPrivate ”和“允许访问文件 URL”选项。
多个浏览器配置文件
具有多个用户配置文件的多个 Microsoft Edge 实例
UiPath Microsoft Edge 扩展程序不支持自动化同时使用多个用户配置文件运行的多个浏览器实例。因此,浏览器自动化要求您关闭 Microsoft Edge 的所有活动实例,并使用单个用户配置文件重新启动浏览器。
停止所有 Microsoft Edge 实例
在某些情况下,Microsoft Edge 后台进程会阻止其完全关闭,即使浏览器实例不可见,这也会干扰自动化。
我们建议通过右键单击系统托盘中的 Microsoft Edge 图标,然后选择“关闭 Microsoft Edge” 来关闭 Microsoft Edge 。这可确保不会在后台继续使用其他用户配置文件。
组策略冲突
使用组策略安装 UiPath Edge 扩展程序时,将在计算机级别更新“扩展程序安装强制列表”。
如果也在用户级别定义 ExtensionInstallForcelist,则可能会导致冲突。
由于计算机级别优先,因此将卸载在用户/云级别设置的扩展程序。
要确认这一点,请在 edge://policy 中检查“扩展程序安装强制列表”下是否显示此警告:
More than one source with conflicting values is present for this policy!
要解决此冲突,请执行以下步骤:
1. Install the UiPath extension for Edge using theNativeHostOnly installation method.
此安装方法可实现扩展程序与 UiPath Studio/Robot 之间的通信。
它不会对组策略进行任何更改。
To use this installation method add EDGE_INSTALL_TYPE=NativeHostOnly to the installation command for UiPathStudio.msi.
示例:
UiPathStudio.msi ADDLOCAL=DesktopFeature,Studio,Robot,RegisterService,EdgeExtension EDGE_INSTALL_TYPE=NativeHostOnly
2. In the ExtensionInstallForcelist policy, add the value:
kcgmcmhhfbcacnlnopghneecffhelmhe;https://edge.microsoft.com/extensionwebstorebase/v1/crx
3. In the NativeMessagingAllowlist policy, add the value:
com.uipath.chromenativemsg_v2
4. Set DeveloperToolsAvailability Group Policy to the value1 (Allow usage of the Developer Tools).
需要此设置才能启用扩展程序的完整功能。
特定于 MV3 扩展程序的已知问题
在特定网页元素上使用“模拟”的“单击”活动失败
使用 Simulate 输入方法的“单击”活动不再适用于具有带 javascript: URI 的单击处理程序的 HTML 元素:
在这种情况下,模拟点击将不会生效,也不会报告任何错误。
This was reported as a Chromium bug here: https://bugs.chromium.org/p/chromium/issues/detail?id=1299742 This issue is quite rare as very few HTML elements have click handlers in this form.
解决方法
此问题有两种解决方法:
- 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 Edge is installed using Group Policy, then the DeveloperToolsAvailability must be set to 1 to enable the full functionality of the extension.
安装扩展程序时,系统会自动正确设置此值,但如果系统管理员为此策略设置了其他值,则系统会覆盖此值。
“开发者工具可用性”的其他值会导致下面列出的问题。
如果 DeveloperToolsAvailability 设置为 0,则:
- UiPath Edge 扩展程序将仅限使用 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 脚本”活动来访问页面变量和代码
By default, the Inject Js Script activity can no longer be used to access page variables, such as jQuery $ , or to interact with page code (e.g., window.alert). The Inject Js Script activity won't report an error, but the script will fail to execute and the following error will be reported in the browser DevTools (F12): Refused to execute inline script because it violates the following Content Security Policy directive.
这是 MV3 平台引入的限制。
要解决此问题,请从“注入 JS 脚本”活动中选择“执行环境 - 页面”选项。
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.
“打开浏览器”活动的超时时间不足
For MV3 extensions, the browser loads the extension later, after the web pages have loaded. This means that on slower machines, the Open Browser activity can reach the internal timeout of 60 seconds before the extension has started.
Starting with UiPath.UiAutomation.Activities v22.10.6, the internal timeout for the Open Browser activity can be configured through the UIPATH_OPEN_BROWSER_TIMEOUT_SECONDS environment variable. For example, set UIPATH_OPEN_BROWSER_TIMEOUT_SECONDS=120 to use 120 seconds for the activity's timeout.
- 检查是否已安装并启用 Microsoft Edge 扩展程序
- 检查 ChromeNativeMessaging.exe 是否正在运行
- 检查 ComSpec 变量是否已正确定义
- 描述
- 解决方案
- 其他解决方法
- 启用对文件 URL 和 InPrivate 的访问权限
- 多个浏览器配置文件
- 具有多个用户配置文件的多个 Microsoft Edge 实例
- 停止所有 Microsoft Edge 实例
- 组策略冲突
- 特定于 MV3 扩展程序的已知问题
- 在特定网页元素上使用“模拟”的“单击”活动失败
- “开发者工具可用性”组策略值必须设置为 1
- UiPath 网页自动化浏览器窗口显示警告
- 无法再使用“注入 JS 脚本”活动来访问页面变量和代码
- “打开浏览器”活动的超时时间不足