 | ValidateAttributeContains Method (IElement, String, String, String, Boolean) |
Validates if the attribute of the specified element contains a specific value.
Namespace:
Ranorex
Assembly:
Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntaxpublic static bool AttributeContains(
IElement element,
string name,
string value,
string message,
bool exceptionOnFail
)
Public Shared Function AttributeContains (
element As IElement,
name As String,
value As String,
message As String,
exceptionOnFail As Boolean
) As Boolean
Parameters
- element
- Type: Ranorex.CoreIElement
The element to validate. - name
- Type: SystemString
The name of the attribute to validate. - value
- Type: SystemString
The value of the attribute to contain. - 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 the expected value. - exceptionOnFail
- Type: SystemBoolean
A value specifying if an exception should be
thrown if the validation fails.
Return Value
Type:
BooleanTrue if the attribute value contains the specified
value;
otherwise
false.
Exceptions| Exception | Condition |
|---|
| ArgumentNullException | If value is null. |
| ValidationException | If the validation fails and
exceptionOnFail is true. |
See Also