getProperty
Overview
Use the getProperty
command to retrieve a property of an element.
Usage
await browser.$(selector).getProperty(property);
Command Parameters
Name | Type | Description |
property | String | The name of the element's property. |
Usage Examples
it("should demonstrate the getProperty command", async ({ browser }) => {
var elem = await browser.$("body");
var tag = await elem.getProperty("tagName");
console.log(tag); // outputs: "BODY"
});
References
We'd like to give credit to the original WebdriverIO docs article, from which we drew some information while writing our version.