Tests if the element has an attribute with the given name and its value is equal to the specified value.

If the attribute has multiple values, the function tests if one of them is equal to the specified value.

This function is basically the same as the following expression:

element.hasAttr(attrName) &&
element.getAttrValues(attrName).contains(value)
However, it will work faster than that expression.

Parameters:

element

The element whose attribute is checked. If not specified, the generator context element is assumed, i.e. the same as the call: hasAttrValue(contextElement, attrName, value)

Note: If this parameter is null, the function returns false.

attrName
The attribute name
value
The value to test

See Also:

hasAttr(), getAttrValue(), checkValueByLPath()
Tips:

(1) You may call this function in a more method-like style, e.g.:

element.hasAttrValue(attrName,value)
(2) Using Location Path, the result returned by this function can also be obtained by the following call:
element.checkValueByLPath("@attrName",value)
(however, it will work more slowly).