MCPcopy
hub / github.com/codeceptjs/CodeceptJS / getProperty

Method getProperty

lib/element/WebElement.js:85–100  ·  view source on GitHub ↗

* Get property value of the element * @param {string} name Property name * @returns {Promise } Property value

(name)

Source from the content-addressed store, hash-verified

83 * @returns {Promise<any>} Property value
84 */
85 async getProperty(name) {
86 switch (this.helperType) {
87 case 'playwright':
88 // For Locator objects, use inputValue() for the 'value' property
89 if (name === 'value' && this.element.inputValue) {
90 return this.element.inputValue()
91 }
92 return this.element.evaluate((el, propName) => el[propName], name)
93 case 'webdriver':
94 return this.element.getProperty(name)
95 case 'puppeteer':
96 return this.element.evaluate((el, propName) => el[propName], name)
97 default:
98 throw new Error(`Unsupported helper type: ${this.helperType}`)
99 }
100 }
101
102 /**
103 * Get innerHTML of the element

Callers 14

getInnerHTMLMethod · 0.80
checkOptionMethod · 0.80
uncheckOptionMethod · 0.80
fillFieldMethod · 0.80
grabTextFromAllMethod · 0.80
grabValueFromAllMethod · 0.80
proceedSeeFunction · 0.80
proceedIsCheckedFunction · 0.80
proceedSeeInFieldFunction · 0.80
proceedMultipleFunction · 0.80
filterFieldsByValueFunction · 0.80
elementSelectedFunction · 0.80

Calls 1

evaluateMethod · 0.80

Tested by

no test coverage detected