Gets the value of the specified attribute for this element.
Namespace: OpenQA.Selenium
Assembly: WebDriver (in WebDriver.dll) Version: 3.1.0
Syntax
Parameters
- attributeName
- Type: SystemString
The name of the attribute.
Return Value
Type: StringThe attribute's current value. Returns a if the value is not set.
Exceptions
Exception | Condition |
---|---|
StaleElementReferenceException | Thrown when the target element is no longer valid in the document DOM. |
Remarks
Attribute name | Value returned if not explicitly specified | Valid element types |
---|---|---|
checked | checked | Check Box |
selected | selected | Options in Select elements |
disabled | disabled | Input and other UI elements |
See Also