メインコンテンツにスキップ

getProperty

Get Element Property コマンドは、要素のプロパティを取得した結果を返します。

使用方法
$(selector).getProperty(property)
パラメータ
名前タイプ詳細
property文字列要素プロパティの名前
getProperty.js
it('should demonstrate the getProperty command', async () => {
var elem = await $('body')
var tag = await elem.getProperty('tagName')
console.log(tag) // outputs: "BODY"
})

ようこそ!何かお困りですか?

WebdriverIO AI Copilot