Get Element Attributes
locator.getAttribute(name) returns the value of an HTML attribute.
On the Text Fields page, the disabled field has:
<input type="text" id="disabledField" value="Codekru" disabled>
Task:
- Navigate to
https://testkru.com/Elements/TextFields - Find the disabled field by ID
- Print its
typeattribute - Print its
valueattribute - Print whether the
disabledattribute exists (it returns empty string or null)
Expected output:
Type: text Value: Codekru Disabled: true
TestKru