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

Method grabAttributeFromAll

lib/helper/Puppeteer.js:2179–2187  ·  view source on GitHub ↗

* {{> grabAttributeFromAll }}

(locator, attr)

Source from the content-addressed store, hash-verified

2177 * {{> grabAttributeFromAll }}
2178 */
2179 async grabAttributeFromAll(locator, attr) {
2180 const els = await this._locate(locator)
2181 const array = []
2182 for (let index = 0; index < els.length; index++) {
2183 const a = await this._evaluateHandeInContext((el, attr) => el[attr] || el.getAttribute(attr), els[index], attr)
2184 array.push(a)
2185 }
2186 return array
2187 }
2188
2189 /**
2190 * {{> grabAttributeFrom }}

Callers 1

grabAttributeFromMethod · 0.95

Calls 4

_locateMethod · 0.95
getAttributeMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected