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

Method grabAttributeFrom

lib/helper/Puppeteer.js:2192–2200  ·  view source on GitHub ↗

* {{> grabAttributeFrom }}

(locator, attr)

Source from the content-addressed store, hash-verified

2190 * {{> grabAttributeFrom }}
2191 */
2192 async grabAttributeFrom(locator, attr) {
2193 const attrs = await this.grabAttributeFromAll(locator, attr)
2194 assertElementExists(attrs, locator)
2195 if (attrs.length > 1) {
2196 this.debugSection('GrabAttribute', `Using first element out of ${attrs.length}`)
2197 }
2198
2199 return attrs[0]
2200 }
2201
2202 /**
2203 * {{> saveElementScreenshot }}

Callers

nothing calls this directly

Calls 2

grabAttributeFromAllMethod · 0.95
assertElementExistsFunction · 0.70

Tested by

no test coverage detected