ApplesauceOS
Read Markdown ↗Download .md

Element.getAttribute

Read one named fresh attribute.

js
element.getAttribute(name)

Arguments

ArgumentTypeMeaning
namestringAttribute name such as identifier, label, visible or rect.

Returns

Attribute value; unknown names throw.

Example

js
const element = UIHelper.waitForElement({id: "target", visible: true, enabled: true}, 5000);
console.log(element.getAttribute("identifier"));

All JavaScript APIs · Automation playbook