 | ValidateAttribute Method (Element, String, Regex, String, ValidateOptions) |
Validates if the attribute of the specified element matches a specific regular expression.
Namespace:
Ranorex
Assembly:
Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntaxpublic static bool Attribute(
Element element,
string name,
Regex regex,
string message,
ValidateOptions options
)
Public Shared Function Attribute (
element As Element,
name As String,
regex As Regex,
message As String,
options As ValidateOptions
) As Boolean
Parameters
- element
- Type: Ranorex.CoreElement
The element to validate. - name
- Type: SystemString
The name of the attribute to validate. - regex
- Type: System.Text.RegularExpressionsRegex
The regular expression to validate the attribute value
string representation against. - message
- Type: SystemString
The message to log. "{0}" is replaced by the string representation of
the element, "{1}" by the attribute name, "{2}" by
the string representation of the actual attribute value (or "(not retrieved)" if the attribute
could not be retrieved), and "{3}" by the string representation of regex. - options
- Type: RanorexValidateOptions
Additional ValidateOptions for this validation action.
Return Value
Type:
BooleanTrue if the specified
regex matches the attribute value;
otherwise
false.
Exceptions
See Also