MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / extractId

Method extractId

javascript/selenium-webdriver/lib/webdriver.js:3233–3240  ·  view source on GitHub ↗

* Extracts the encoded ShadowRoot ID from the object. * * @param {?} obj The object to extract the ID from. * @return {string} the extracted ID. * @throws {TypeError} if the object is not a valid encoded ID.

(obj)

Source from the content-addressed store, hash-verified

3231 * @throws {TypeError} if the object is not a valid encoded ID.
3232 */
3233 static extractId(obj) {
3234 if (obj && typeof obj === 'object') {
3235 if (typeof obj[SHADOW_ROOT_ID_KEY] === 'string') {
3236 return obj[SHADOW_ROOT_ID_KEY]
3237 }
3238 }
3239 throw new TypeError('object is not a ShadowRoot ID')
3240 }
3241
3242 /**
3243 * @param {?} obj the object to test.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected