 | BaseElementGetAttribute Method |
Gets the value of the specified attribute for this element.
Namespace:
TescoSW.MW.UITests.Common.PageModel.Components
Assembly:
TescoSW.MW.UITests.Common (in TescoSW.MW.UITests.Common.dll) Version: 15.2.7099.36746
Syntaxpublic string GetAttribute(
string attributeName
)
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.
Implements
IWebElement.GetAttribute(String)
ExceptionsException | Condition |
---|
StaleElementReferenceException | Thrown when the target element is no longer valid in the document DOM. |
RemarksThe
GetAttribute(String) method will return the current value
of the attribute, even if the value has been modified after the page has been
loaded. Note that the value of the following attributes will be returned even if
there is no explicit attribute on the element:
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