July 2019
Intermediate to advanced
536 pages
12h 57m
English
The getAttribute method can be executed on all the WebElements. Remember, we have seen attributes of WebElement in the WebElements section. The HTML attributes are modifiers of HTML elements. They are generally key-value pairs that appear in the start tag of an element. For example:
<label name="Username" id="uname">Enter Username: </label>
In the preceding code, name and id are the attributes or attribute keys and Username and uname are the attribute values.
The API syntax of the getAttribute() method is as follows:
java.lang.String getAttribute(java.lang.String name)
In the preceding code, the input parameter is String, which is the name of the attribute. The return type is again String, which is the value of ...
Read now
Unlock full access