Skip to main content

getComputedLabel

Overview

Use the getComputedLabel command to get the computed WAI-ARIA label of an element.

Usage

await browser.$(selector).getComputedLabel();

Usage Examples

it("should demonstrate the getComputedLabel command", async ({ browser }) => {
await browser.url("https://www.google.com/ncr");
const elem = await browser.$('*[name="q"]');
console.log(await elem.getComputedLabel()); // outputs: "Search"
});

References

We'd like to give credit to the original WebdriverIO docs article, from which we drew some information while writing our version.