getAttribute
Get an attribute from a DOM-element based on the selector and attribute name. Returns a list of attribute values if selector matches multiple elements.
Usage
1 | browser.getAttribute(selector,attributeName); |
Parameters
Param | Type | Details |
---|---|---|
selector | String | element with requested attribute |
attributeName | String | requested attribute |
Example
1 | <form action="/submit" method="post" class="loginForm"> |
1 | it('should demonstrate the getAttribute command', function () { |
Returns
- <String/String[]/null>: The value of the attribute(s), or null if it is not set on the element.