Skip to main content

getProperty

The Get Element Property command will return the result of getting a property of an element.

Usage

await $(selector).getProperty(property)

Parameters

NameTypeDetails
propertystringname of the element property

Example

getProperty.js
it('should demonstrate the getProperty command', async () => {
var elem = await $('body')
var tag = await elem.getProperty('tagName')
console.log(tag) // outputs: "BODY"
})

Returns

  • <unknown> return: the value of the property of the selected element

Welcome! How can I help?

WebdriverIO AI Copilot