TestingOptions.CompareDocuments Class
Use this class to configure options for comparing documents with the ComparePdfDocuments coded automation API.
Definition
Namespace: UiPath.Testing.API.Models
Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)
Syntax
public class TestingOptions : CompareDocuments
Constructors
public TestingOptions.CompareDocuments()
TestingOptions.CompareDocuments : Initializes a new instance of the TestingOptions.CompareDocuments class.
Properties
AdditionalOutputFilePath String : Path to the additional output file. Needs to be set if OutputDiffType is PDF.
ContinueOnError Boolean : Specifies if the automation should continue even when the method throws an error. This parameter only supports Boolean values such as true or false. The default value is false. As a result, if the parameter is blank and an error is thrown, the execution of the project stops. If the value is set to true, the execution of the project continues regardless of any error.
GenerateSemanticResult Boolean : Perform the verification using the AI capabilities that AutopilotTM offers to obtain a semantic interpretation of the differences. This generates an additional result with the semantic differences.
Depending on licensing plan you enrolled in, the Semantic result type consumes one of the following for each coded automation API execution:
- For the Flex licensing plan, the Semantic result type consumes one AI unit.
- For the Unified Pricing licensing plan, the Semantic result type consumes one Platform unit. For more information on consumption, visit About the Testing activity package.
IgnoreIdenticalItems Boolean : If set to True, identical items are ignored during comparison. This is useful when comparing static objects, such as watermarks or headers. By default, this is set to True.
IgnoreWidgetsLocation Boolean : If set to True, ignores the location of an image or URL in the compared documents. By default, this is set to False.
IncludeWidgets Boolean : If set to True, the comparison process also includes images and URLs. By default, this is set to True.
OutputDiffType DocumentOutputDiffType : The type you want to use for returning the differences between the documents.
OutputFilePath String : The output path of the base document.
Rules List<ComparisonRule> : List of rules to be applied. They can be of type RegexRule or WildcardRule.
WordSeparators String : The objects, as Strings, that you want to consider as word separators in the comparison process. For example, if the documents you are comparing commonly use a period . or backslashes / for separating words, then you can define these as word separators.
Methods
These are the methods you can use to configure the document comparison options.
WithContinueOnError
Configure if the automation should continue even when the method throws an error.
Definition
Namespace: UiPath.Testing.API.Models
Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)
WithContinueOnError(bool)
WithIgnoreRegexRule(
bool continueOnError
)
continueOnError Boolean : Specifies if the automation should continue even when the method throws an error. This parameter only supports Boolean values (true, false). The default value is false. As a result, if the parameter is blank and an error is thrown, the execution of the project stops. If the value is set to true, the execution of the project continues regardless of any error.
WithGenerateHtml
Generates an HTML file with the highlighted differences identified between the two documents or texts.
Definition
Namespace: UiPath.Testing.API.Models
Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)
WithGenerateHtml(string)
WithGenerateHtml(
string filePath
)
filePath String : The path of the HTML file that stores the differences identified when comparing the documents or texts.
WithGeneratePDF
Generates new PDF files with the highlighted differences for both the baseline document and the target document, used to compare against the baseline document.
Definition
Namespace: UiPath.Testing.API.Models
Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)
WithGeneratePDF(string, string)
WithGeneratePDF(
string baselinePath,
string targetPath
)
baselinePath String : The new path of the baseline document, where you want to store the PDF file that highlighted the identified differences.
targetPath String : The new path of the target document, where you want to store the PDF file that highlighted the identified differences.
WithGenerateSemanticResult
Perform the verification using the AI capabilities that AutopilotTM offers to obtain a semantic interpretation of the differences. This generates an additional result with the semantic differences.
Depending on licensing plan you enrolled in, the Semantic result type consumes one of the following for each coded automation API execution:
- For the Flex licensing plan, the Semantic result type consumes one AI unit.
- For the Unified Pricing licensing plan, the Semantic result type consumes one Platform unit. For more information on consumption, visit About the Testing activity package.
Definition
Namespace: UiPath.Testing.API.Models
Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)
WithGenerateSemanticResult(bool)
WithGenerateSemanticResult(
bool generateSemanticResult = false
)
generateSemanticResult Boolean : If set to true, performs the verification using AI capabilities. By default, this is set to false.
Return value
SemanticDifferences
The result of the verification process, performed using AI capabilities.
WithIgnoreIdenticalItems
If set to True, identical lines are ignored during comparison. This is useful, in particular, when comparing static objects, such as watermarks or headers.
Definition
Namespace: UiPath.Testing.API.Models
Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)
WithIgnoreIdenticalItems(bool)
CompareDocumentsOptions WithIgnoreIdenticalItems<CompareDocumentsOptions>(
bool ignoreIdenticalItems = true
)
ignoreIdenticalItems Boolean : Specifies if identical items should be ignored during comparison. By default, this parameter is set to true.
WithIgnoreWidgetsPageAndPosition
If set to true, ignores the position and page of an image or URL.
Definition
Namespace: UiPath.Testing.API.Models
Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)
WithIgnoreWidgetsPageAndPosition(this, bool)
WithIgnoreWidgetsPageAndPosition(
bool ignoreWidgetsPageAndPosition = false
)
ignoreWidgetsPageAndPosition Boolean : If set to true, ignores the position and page of an image or URL. By default, the value of the parameter is false.
WithIgnoreRegexRule
If set to True, ignores any Regex rule that you configured for the Rules parameter. This allows you to exclude certain parts of the texts or documents that you are comparing.
Definition
Namespace: 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]
)
ruleName String : The name of the rule, as you configured it in the list of Rules, that you want to ignore in the comparison process.
regexPattern String : The actual regex that represents the ruleName previously entered.
usePlaceholder Boolean (Optional) : If set to True it replaces the ignored part of a document or text with a placeholder value. The placeholder value is the ruleName. By default, this parameter is set to true.
WithIgnoreWildcardRule
If set to True, ignores any wild card rule that you configured for the Rules parameter. This allows you to exclude certain parts of the texts or documents that you are comparing.
Definition
Namespace: 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]
)
ruleName String : The name of the rule, as you configured it in the list of Rules, that you want to ignore in the comparison process.
wildcardPattern String : The actual wildcard that represents the ruleName previously entered.
usePlaceholder Boolean (Optional) : If set to True it replaces the ignored part of a document or text with a placeholder value. The placeholder value is the ruleName. By default, this parameter is set to true.
WithIncludeWidgets
Includes images and URLs in the comparison process. If you set this method to True, it also compares images and URLs, when verifying the equivalence between documents or texts.
Definition
Namespace: UiPath.Testing.API.Models
Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)
WithIncludeWidgets(bool)
WithIncludeWidgets(
bool includeWidgets
)
includeWidgets Boolean : If set to True, the coded automation API also compares images and URLs when verifying the equivalence between documents and texts.
WithWordSeparators
Specify the characters that you want to define as word separators. The characters must be stored in a string.
Definition
Namespace: UiPath.Testing.API.Models
Assembly: UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)
WithWordSeparators(string)
WithWordSeparators(
string wordSeparators
)
wordSeparators String : The string containing the characters that you want to consider as word separators.