activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

工作流活动

上次更新日期 2025年10月17日

TestingOptions.CompareText 类

使用此类配置用于与比较文本编码自动化 API 比较文档的选项。

定义

命名空间:UiPath.Testing.API.Models

Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)

语法

public class TestingOptions : CompareTextpublic class TestingOptions : CompareText

构造函数

public TestingOptions.CompareText()public TestingOptions.CompareText()
TestingOptions.CompareText
初始化“ TestingOptions.CompareText ”类的新实例。

属性

AdditionalOutputFilePath 字符串
到其他输出文件的路径。如果 OutputDiffType 是 PDF,则需要设置。
ContinueOnError 布尔值
指定如果方法引发错误,是否仍应继续自动化。
GenerateSemanticResult 布尔值
使用 Autopilot TM提供的 AI 功能执行验证,以获得差异的语义解释。这将生成具有语义差异的其他结果。
注意:根据您注册的许可计划,语义结果类型会为每次编码自动化 API 执行使用以下其中一项资源:
  • 对于 Flex 许可计划,语义结果类型消耗 1 个 AI Unit。
  • 对于Unified Pricing许可计划,语义结果类型消耗一个平台单元。
有关使用的更多信息,请访问关于测试活动包
OutputDiffType DocumentOutputDiffType
用于显示文本之间差异的格式。
OutputFilePath 字符串
显示文本之间差异的输出文件的路径。
规则 列表<ComparisonRule>
要应用的规则列表。它们的类型可以是 RegexRuleWildcardRule
WordSeparators 字符串
在比较过程中应被视为单词分隔符的字符。例如,如果您要比较的文本通常使用句点.或反斜杠/来分隔单词,则您可以将其定义为单词分隔符。默认情况下,分隔符为句点. 、逗号, 、感叹号! 、问号? 、冒号:和反斜杠\n

方法

您可以通过这些方法配置文本比较选项。

WithContinueOnError

配置在该方法引发错误时是否应继续自动化。

定义

命名空间:UiPath.Testing.API.Models

Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)

WithContinueOnError(bool)
WithIgnoreRegexRule(
    bool continueOnError
)WithIgnoreRegexRule(
    bool continueOnError
)
continueOnError 布尔值
指定在方法抛出错误时是否应继续自动化。 此参数仅支持布尔值( truefalse )。 默认值为false 。 因此,如果参数为空且活动引发错误,系统将停止执行项目。 如果该值设为true ,则无论出现何种错误,系统都将继续执行项目。

WithGenerateHtml

生成一个 HTML 文件,其中高亮显示两个文档或文本之间识别的差异。

定义

命名空间:UiPath.Testing.API.Models

Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)

WithGenerateHtml(string)
WithGenerateHtml(
    string filePath
)WithGenerateHtml(
    string filePath
)
文件路径 字符串
HTML 文件的路径,该文件用于存储比较文档或文本时识别的差异。

WithGenerateSemanticResult

使用 Autopilot TM提供的 AI 功能执行验证,以获得差异的语义解释。这将生成具有语义差异的其他结果。
注意:根据您注册的许可计划,语义结果类型会为每次编码自动化 API 执行使用以下其中一项资源:
  • 对于 Flex 许可计划,语义结果类型消耗 1 个 AI Unit。
  • 对于Unified Pricing许可计划,语义结果类型消耗一个平台单元。
有关使用的更多信息,请访问关于测试活动包
定义

命名空间:UiPath.Testing.API.Models

Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)

WithGenerateSemanticResult(bool)
WithGenerateSemanticResult(
    bool generateSemanticResult = false
)WithGenerateSemanticResult(
    bool generateSemanticResult = false
)
generateSemanticResult 布尔值
如果设置为true ,则使用 AI 功能执行验证。默认情况下,这设置为false
返回值

SemanticDifferences

使用 AI 功能执行的验证流程的结果。

WithIgnoreRegexRule

如果设置为 True,则忽略您为 Rules 参数配置的任何正则表达式规则。这使您可以排除要比较的文本或文档的某些部分。
定义

命名空间:UiPath.Testing.API.Models

Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)

WithIgnoreRegexRule(string, string, [bool])
WithIgnoreRegexRule(
    string ruleName,
    string regexPattern,
    [bool usePlaceholders = true]
)WithIgnoreRegexRule(
    string ruleName,
    string regexPattern,
    [bool usePlaceholders = true]
)
ruleName 字符串
要在比较过程中忽略的规则名称(在 Rules 列表中配置)。
regexPattern 字符串
表示先前输入的 ruleName 的实际正则表达式。
usePlaceholder 布尔值(可选)
如果设置为 True,则它会将文档或文本中被忽略的部分替换为占位符值。占位符值为 ruleName。默认情况下,此参数设置为 true

WithIgnoreWildcardRule

如果设置为 True,则忽略您为 Rules 参数配置的任何通配符规则。这使您可以排除要比较的文本或文档的某些部分。
定义

命名空间:UiPath.Testing.API.Models

Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)

WithIgnoreWildcardRule(string, string, bool)
WithIgnoreWildcardRule(
    string ruleName,
    string wildcardPattern,
    [bool usePlaceholder = true]
)WithIgnoreWildcardRule(
    string ruleName,
    string wildcardPattern,
    [bool usePlaceholder = true]
)
ruleName 字符串
要在比较过程中忽略的规则名称(在 Rules 列表中配置)。
wildcardPattern 字符串
表示先前输入的 ruleName 的实际通配符。
usePlaceholder 布尔值(可选)
如果设置为 True,则它会将文档或文本中被忽略的部分替换为占位符值。占位符值为 ruleName。默认情况下,此参数设置为 true

WithWordSeparators

指定要定义为单词分隔符的字符。字符必须存储在字符串中。

定义

命名空间:UiPath.Testing.API.Models

Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)

WithWordSeparators(string)
WithWordSeparators(
    string wordSeparators
)WithWordSeparators(
    string wordSeparators
)
wordSeparators 字符串
此为包含要视为单词分隔符的字符的字符串。
  • 定义
  • 语法
  • 构造函数
  • 属性
  • 方法
  • WithContinueOnError
  • WithGenerateHtml
  • WithGenerateSemanticResult
  • WithIgnoreRegexRule
  • WithIgnoreWildcardRule
  • WithWordSeparators

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2025 UiPath。保留所有权利。