RanorexRanorex Documentation
Attribute Method (itemInfo, name, regex, message, exceptionOnFail)
NamespacesRanorexValidateAttribute(RepoItemInfo, String, Regex, String, Boolean)
Validates if the attribute of the element for the specified repository item matches a specific regular expression.
Declaration Syntax
C#Visual BasicVisual C++
public static bool Attribute(
	RepoItemInfo itemInfo,
	string name,
	Regex regex,
	string message,
	bool exceptionOnFail
)
Public Shared Function Attribute ( _
	itemInfo As RepoItemInfo, _
	name As String, _
	regex As Regex, _
	message As String, _
	exceptionOnFail As Boolean _
) As Boolean
public:
static bool Attribute(
	RepoItemInfo^ itemInfo, 
	String^ name, 
	Regex^ regex, 
	String^ message, 
	bool exceptionOnFail
)
Parameters
itemInfo (RepoItemInfo)
The RepoItemInfo object for the repository item.
name (String)
The name of the attribute to validate.
regex (Regex)
The regular expression to validate the attribute value string representation against.
message (String)
The message to log. "{0}" is replaced by the name of the itemInfo object, "{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.
exceptionOnFail (Boolean)
A value specifying if an exception should be thrown if the validation fails.
Return Value
True if the specified regex matches the attribute value; otherwise false.
Exceptions
ExceptionCondition
ValidationExceptionIf the validation fails and exceptionOnFail is true.

Assembly: Ranorex.Core (Module: Ranorex.Core) Version: 4.0.4.23593 (4.0.4.23593)