Aller au contenu principal

getProperty

La commande Get Element Property renvoie le résultat de l'obtention d'une propriété d'un élément.

Utilisation
$(selector).getProperty(property)
Paramètres
NomTypeDétails
propertystringnom de la propriété de l'élément
Exemple
getProperty.js
it('should demonstrate the getProperty command', async () => {
var elem = await $('body')
var tag = await elem.getProperty('tagName')
console.log(tag) // outputs: "BODY"
})
Retourne
  • <unknown> return: la valeur de la propriété de l'élément sélectionné

Welcome! How can I help?

WebdriverIO AI Copilot