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

Studio 用户指南
故障排除
本主题介绍了 Firefox 扩展程序可能无法正常工作的常见原因,以及针对这些问题的解决方案。
- If the extension is already installed in Firefox, it will continue to work even after the root certificate expires.
- If the extension is installed after the root certificate expires, it will be disabled and will not work.
You can apply certain workarounds, but this depends on how old your Firefox version is and whether or not it is an ESR (Extended Support Release) version.
面向 Firefox ESR 的解决方案
-
转到
about:config
。 -
将
xpinstall.signatures.required
标志切换为false
。
It is preferable to automatically apply this setting to all profiles using one of the methods listed below.
Firefox v102.10 ESR 或更高版本
xpinstall.signatures.required
偏好。有关更多详细信息,请参阅“面向 Firefox 的策略模板”。
低于 v102.10 ESR 的 Firefox
xpinstall.signatures.required
。作为替代方案,您可以使用 AutoConfig 文件:
-
将以下内容保存到文本文件中:
// First line must be a comment. pref("xpinstall.signatures.required", false);
// First line must be a comment. pref("xpinstall.signatures.required", false); -
对文本文件
allow-unsigned-extensions.cfg
进行命名。 -
将以下内容保存到文本文件中:
// First line must be a comment. pref("general.config.filename", "allow-unsigned-extensions.cfg"); pref("general.config.obscure_value", 0);
// First line must be a comment. pref("general.config.filename", "allow-unsigned-extensions.cfg"); pref("general.config.obscure_value", 0); -
对文本文件
allow-unsigned-extensions.js
进行命名。 -
找到 Firefox 安装目录,通常为
C:\Program Files\Mozilla Firefox
。 -
将
allow-unsigned-extensions.cfg
复制到C:\Program Files\Mozilla Firefox
。 -
将
allow-unsigned-extensions.js
复制到C:\Program Files\Mozilla Firefox\pref
。
Firefox - 标准版本
对于非 ESR 版本的 Firefox,您必须使用 AutoConfig 文件。
-
将以下内容保存到文本文件中:
// First line must be a comment. // In Firefox 55+, settings to configure add-on signing (and legacy add-ons) are stored in AddonSettings.jsm // The module exports an object with read-only properties, but that is not an issue since we can just replace // the exported object. // https://searchfox.org/mozilla-central/rev/2e08acdf8862e68b13166970e17809a3b5d6a555/toolkit/mozapps/extensions/internal/AddonSettings.jsm Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); function patchAddonSettings(modulePath) { var Module = Components.utils.import(modulePath, {}); // Note: we read the data from preferences instead of hard-coding a "true", so // that by default legacy add-ons are disabled. This enables the user to only // enable legacy add-ons for specific Firefox profiles when really needed. var AddonSettings; if ("lazy" in Module) { AddonSettings = Object.create(Module.lazy.AddonSettings); } else { AddonSettings = Object.create(Module.AddonSettings); } XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "REQUIRE_SIGNING", "xpinstall.signatures.required", false); XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "ALLOW_LEGACY_EXTENSIONS", "extensions.legacy.enabled", true); XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "LANGPACKS_REQUIRE_SIGNING", "extensions.langpacks.signatures.required", false); if ("lazy" in Module) { Module.lazy.AddonSettings = AddonSettings; } else { Module.AddonSettings = AddonSettings; } } // This is necessary to allow legacy add-ons via preferences. try { patchAddonSettings("resource://gre/modules/addons/XPIProvider.jsm"); } catch (e) { // AddonSettings is not in this file starting with Firefox 61, // but it comes back in Firefox 74 } try { patchAddonSettings("resource://gre/modules/addons/XPIDatabase.jsm"); } catch (e) { // AddonSettings is not in this file until Firefox 61 } // This override is needed to enable unsigned add-ons via preferences. patchAddonSettings("resource://gre/modules/addons/XPIInstall.jsm"); // This override is needed to allow unsigned add-ons to show up without warning in about:addons. // (this is UI-only, the add-on is not actually disabled despite what the UI claims). patchAddonSettings("resource://gre/modules/addons/AddonSettings.jsm"); Components.classes['@mozilla.org/consoleservice;1'] .getService(Components.interfaces.nsIConsoleService) .logStringMessage("enablelegacy.cfg: the extensions.legacy.enabled preference is working again."); pref("xpinstall.signatures.required", false);
// First line must be a comment. // In Firefox 55+, settings to configure add-on signing (and legacy add-ons) are stored in AddonSettings.jsm // The module exports an object with read-only properties, but that is not an issue since we can just replace // the exported object. // https://searchfox.org/mozilla-central/rev/2e08acdf8862e68b13166970e17809a3b5d6a555/toolkit/mozapps/extensions/internal/AddonSettings.jsm Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); function patchAddonSettings(modulePath) { var Module = Components.utils.import(modulePath, {}); // Note: we read the data from preferences instead of hard-coding a "true", so // that by default legacy add-ons are disabled. This enables the user to only // enable legacy add-ons for specific Firefox profiles when really needed. var AddonSettings; if ("lazy" in Module) { AddonSettings = Object.create(Module.lazy.AddonSettings); } else { AddonSettings = Object.create(Module.AddonSettings); } XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "REQUIRE_SIGNING", "xpinstall.signatures.required", false); XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "ALLOW_LEGACY_EXTENSIONS", "extensions.legacy.enabled", true); XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "LANGPACKS_REQUIRE_SIGNING", "extensions.langpacks.signatures.required", false); if ("lazy" in Module) { Module.lazy.AddonSettings = AddonSettings; } else { Module.AddonSettings = AddonSettings; } } // This is necessary to allow legacy add-ons via preferences. try { patchAddonSettings("resource://gre/modules/addons/XPIProvider.jsm"); } catch (e) { // AddonSettings is not in this file starting with Firefox 61, // but it comes back in Firefox 74 } try { patchAddonSettings("resource://gre/modules/addons/XPIDatabase.jsm"); } catch (e) { // AddonSettings is not in this file until Firefox 61 } // This override is needed to enable unsigned add-ons via preferences. patchAddonSettings("resource://gre/modules/addons/XPIInstall.jsm"); // This override is needed to allow unsigned add-ons to show up without warning in about:addons. // (this is UI-only, the add-on is not actually disabled despite what the UI claims). patchAddonSettings("resource://gre/modules/addons/AddonSettings.jsm"); Components.classes['@mozilla.org/consoleservice;1'] .getService(Components.interfaces.nsIConsoleService) .logStringMessage("enablelegacy.cfg: the extensions.legacy.enabled preference is working again."); pref("xpinstall.signatures.required", false); -
对文本文件
enable-legacy.cfg
进行命名。 -
将以下内容保存到文本文件中:
// First line must be a comment. pref("general.config.filename", "enablelegacy.cfg"); pref("general.config.obscure_value", 0); pref("general.config.sandbox_enabled", false);
// First line must be a comment. pref("general.config.filename", "enablelegacy.cfg"); pref("general.config.obscure_value", 0); pref("general.config.sandbox_enabled", false); -
对文本文件
enablelegacy-prefs.js
进行命名。 -
找到 Firefox 安装目录,通常为
C:\Program Files\Mozilla Firefox
。 -
将
allow-unsigned-extensions.cfg
复制到C:\Program Files\Mozilla Firefox
。 -
将
allow-unsigned-extensions.js
复制到C:\Program Files\Mozilla Firefox\defaults\pref
。
Recent versions of Firefox, like 102.10 ESR, re-enable the extension automatically once the flag is set. In older versions such as 68.0.2 ESR, it may be necessary to reinstall the extension.
离线组策略安装方法不适用于 Firefox 68.0.2 ESR,更低版本可能也不适用。临时解决方法需要将以下内容添加到 PowerShell 脚本中,然后以管理员权限运行:
# Define the registry path
$regPath = "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\Extensions\Install"
function Convert-WindowsPathToFileUrl($path) {
$unixPath = $path -replace '\\', '/'
$escapedPath = $unixPath -replace ' ', '%20'
return "file:///" + $escapedPath
}
function Fix-FirefoxProfile($prefsPath, $fileUrl) {
if (-not (Test-Path $prefsPath)) {
Write-Host "prefs.js not found: $prefsPath"
return
}
Write-Host "Processing prefs.js: $prefsPath"
$content = Get-Content -Path $prefsPath -Raw
$pattern = 'user_pref\("browser\.policies\.runOncePerModification\.extensionsInstall",\s*"(.+?)"\);'
if (-not ($content -match $pattern)) {
Write-Host " -> No matching preference found in prefs.js."
return
}
$jsonArrayString = $matches[1]
# Unescape \" to "
$jsonArrayStringUnescaped = $jsonArrayString -replace '\\\"', '"'
try {
$list = ConvertFrom-Json -InputObject $jsonArrayStringUnescaped
} catch {
Write-Host " -> Error parsing JSON inside prefs.js preference (after unescaping)."
return
}
if (-not ($list -contains $fileUrl)) {
Write-Host " -> File URL not present in extensionsInstall list."
return
}
$newList = $list | Where-Object { $_ -ne $fileUrl }
$newJsonArrayString = ($newList | ConvertTo-Json -Compress)
# prefs.js expects it wrapped as a string, escaping " as \"
$escapedNewJsonArrayString = $newJsonArrayString -replace '"', '\"'
$newPrefLine = "user_pref(""browser.policies.runOncePerModification.extensionsInstall"", `"$escapedNewJsonArrayString`");"
# Replace the old line
$oldPrefLine = $matches[0]
$content = $content -replace [regex]::Escape($oldPrefLine), $newPrefLine
Set-Content -Path $prefsPath -Value $content -Encoding UTF8
Write-Host " -> prefs.js updated."
}
function Fix-AllFirefoxProfiles($fileUrl) {
$profilesPath = "$env:APPDATA\Mozilla\Firefox\Profiles"
if (-not (Test-Path $profilesPath)) {
Write-Host "Firefox profiles directory not found: $profilesPath"
return
}
$profiles = Get-ChildItem -Path $profilesPath -Directory
foreach ($profile in $profiles) {
$prefsPath = Join-Path $profile.FullName "prefs.js"
Fix-FirefoxProfile -prefsPath $prefsPath -fileUrl $fileUrl
}
}
if (-not (Test-Path $regPath)) {
Write-Host "Registry path not found: $regPath"
return
}
$values = Get-ItemProperty -Path $regPath
foreach ($property in $values.PSObject.Properties) {
$name = $property.Name
$value = $property.Value
if ($value -notmatch "^[a-zA-Z]:\\.*\\uipath-ff\.xpi$") {
continue
}
Write-Host "Found Windows path for uipath-ff.xpi in entry '$name': $value"
$fileUrl = Convert-WindowsPathToFileUrl $value
Write-Host " -> Converted to file URL: $fileUrl"
Set-ItemProperty -Path $regPath -Name $name -Value $fileUrl
Write-Host " -> Updated registry key '$name'."
Fix-AllFirefoxProfiles -fileUrl $fileUrl
}
# Define the registry path
$regPath = "HKLM:\SOFTWARE\Policies\Mozilla\Firefox\Extensions\Install"
function Convert-WindowsPathToFileUrl($path) {
$unixPath = $path -replace '\\', '/'
$escapedPath = $unixPath -replace ' ', '%20'
return "file:///" + $escapedPath
}
function Fix-FirefoxProfile($prefsPath, $fileUrl) {
if (-not (Test-Path $prefsPath)) {
Write-Host "prefs.js not found: $prefsPath"
return
}
Write-Host "Processing prefs.js: $prefsPath"
$content = Get-Content -Path $prefsPath -Raw
$pattern = 'user_pref\("browser\.policies\.runOncePerModification\.extensionsInstall",\s*"(.+?)"\);'
if (-not ($content -match $pattern)) {
Write-Host " -> No matching preference found in prefs.js."
return
}
$jsonArrayString = $matches[1]
# Unescape \" to "
$jsonArrayStringUnescaped = $jsonArrayString -replace '\\\"', '"'
try {
$list = ConvertFrom-Json -InputObject $jsonArrayStringUnescaped
} catch {
Write-Host " -> Error parsing JSON inside prefs.js preference (after unescaping)."
return
}
if (-not ($list -contains $fileUrl)) {
Write-Host " -> File URL not present in extensionsInstall list."
return
}
$newList = $list | Where-Object { $_ -ne $fileUrl }
$newJsonArrayString = ($newList | ConvertTo-Json -Compress)
# prefs.js expects it wrapped as a string, escaping " as \"
$escapedNewJsonArrayString = $newJsonArrayString -replace '"', '\"'
$newPrefLine = "user_pref(""browser.policies.runOncePerModification.extensionsInstall"", `"$escapedNewJsonArrayString`");"
# Replace the old line
$oldPrefLine = $matches[0]
$content = $content -replace [regex]::Escape($oldPrefLine), $newPrefLine
Set-Content -Path $prefsPath -Value $content -Encoding UTF8
Write-Host " -> prefs.js updated."
}
function Fix-AllFirefoxProfiles($fileUrl) {
$profilesPath = "$env:APPDATA\Mozilla\Firefox\Profiles"
if (-not (Test-Path $profilesPath)) {
Write-Host "Firefox profiles directory not found: $profilesPath"
return
}
$profiles = Get-ChildItem -Path $profilesPath -Directory
foreach ($profile in $profiles) {
$prefsPath = Join-Path $profile.FullName "prefs.js"
Fix-FirefoxProfile -prefsPath $prefsPath -fileUrl $fileUrl
}
}
if (-not (Test-Path $regPath)) {
Write-Host "Registry path not found: $regPath"
return
}
$values = Get-ItemProperty -Path $regPath
foreach ($property in $values.PSObject.Properties) {
$name = $property.Name
$value = $property.Value
if ($value -notmatch "^[a-zA-Z]:\\.*\\uipath-ff\.xpi$") {
continue
}
Write-Host "Found Windows path for uipath-ff.xpi in entry '$name': $value"
$fileUrl = Convert-WindowsPathToFileUrl $value
Write-Host " -> Converted to file URL: $fileUrl"
Set-ItemProperty -Path $regPath -Name $name -Value $fileUrl
Write-Host " -> Updated registry key '$name'."
Fix-AllFirefoxProfiles -fileUrl $fileUrl
}
描述
Mozilla 在 Firefox 中引入了扩展程序签名验证算法,该算法会禁用 Firefox 65.0 版及更低版本的插件。因此,如果您在 65.0 版或更低版本的浏览器上安装适用于 Firefox 的 UiPath 扩展程序,将显示以下错误消息:
This add-on could not be installed because it appears to be corrupt.
解决方案 1
将 Firefox 更新到版本 v66.0.4 或更高版本。
解决方案 2
从 Studio 2020.8 开始,Firefox 扩展程序是新签名的,应该可以在较旧版本的 Firefox 浏览器上正确安装。
描述
Starting with Firefox v138, the following prompt is displayed when starting the browser and may affect your automations:
解决方案
The only solution to skip this prompt is to set the SkipTermsOfUse Group Policy as described here.
检查 UiPath Firefox 扩展程序是否已安装并启用:
- 在 Mozilla Firefox 中,转到“about:addons”>“扩展程序”。
- 如果扩展程序不存在,请按这里的说明来安装。
- 确保 UiPath 扩展程序已更新为最新版本。
为防止可能出现的问题:
- 在 Mozilla Firefox 中,转到“about:addons”>“扩展程序”。
- 打开任务管理器或进程资源管理器。
- 检查
ChromeNativeMessaging.exe
进程是否正在运行:注意:一个单独的ChromeNativeMessaging
实例会针对 Chrome 扩展程序运行,所以在执行此检查时需要关闭 Google Chrome。
ChromeNativeMessaging
未在运行:
- 在 Mozilla Firefox 中,转到“about:addons”>“扩展程序”。
- 通过单击“删除”按钮手动删除 UiPath 扩展程序。
- 按照此处的说明,重新安装。
如果上面的信息未能解决您的问题,您可以尝试通过查看追踪,并分析 UiPath 扩展程序抛出的错误,从而获得其他信息。以下是您可以收集和分析的追踪类型:
适用于 Google Chrome 中的一般扩展程序追踪:
转到“打开”菜单 >“网页开发者”>“浏览器控制台”(Ctrl+Shift+J)。将显示“浏览器控制台” 。此处显示扩展程序生成的所有错误。
对于要自动化的网页生成的追踪:
转到“打开”菜单 >“网页开发者”>“网页控制台”(Ctrl+Shift+K)。系统将显示网页控制台。当前网页的所有错误都将显示在此处。
对于完整追踪(不仅限于错误),请执行以下操作:
- 打开注册表编辑器。
- 导航到
HKEY_CURRENT_USER\SOFTWARE\UiPath
键。 - 双击网页扩展程序跟踪 REG_DWORD 值。系统将显示编辑 DWORD 值窗口。
- 在值数据字段中,将值更改为 1,然后单击“确定”。值即已保存。
注意:如果
WebExtensionTrace
REG_DWORD 值不存在,则必须创建此值,方法是在右侧面板中单击右键,选择“新建”>“DWORD(32 位)值”,然后提供上述值。
检查注册表编辑器中是否缺少某些数据:
- 打开注册表编辑器。
- 导航到
HKEY_CURRENT_USER\SOFTWARE\Mozilla\NativeMessagingHosts\com.uipath.chromenativemsg
键。 - 打开
(Default)
REG_SZ 值。系统将显示编辑字符串窗口,且其中应包含类似于C:\Users\YOUR_USER_NAME\AppData\Local\UiPath\uipath-ff.json
的路径。 - 使用文本编辑器(如 Notepad++)在上面找到的路径上打开 .json 文件。
- 检查路径属性是否正确指向
ChromeNativeMessaging.exe
的所在位置,类似于C:\Program Files (x86)\UiPath Studio\UiPath\BrowserExtension\ChromeNativeMessaging.exe
。
从 UiPath 版本 2023.10 开始,适用于 Firefox 的 Uipath 扩展程序支持自动化同时使用多个用户配置文件运行的多个浏览器实例。
使用“使用应用程序/浏览器”活动时,现在可以使用特定的配置文件打开浏览器。要在浏览器启动时指定配置文件,您必须将参数附加到浏览器命令行中。为此,请使用“统一应用程序目标”输入部分中的“参数”属性。
-profile "full_profile_path"
。要检索完整的配置文件路径,请导航至 about:profiles
并检索该配置文件的根目录。