MCPcopy
hub / github.com/ChromeDevTools/chrome-devtools-mcp / getElementByUid

Method getElementByUid

src/McpPage.ts:337–348  ·  view source on GitHub ↗
(uid: string)

Source from the content-addressed store, hash-verified

335 }
336
337 async getElementByUid(uid: string): Promise<ElementHandle<Element>> {
338 if (!this.textSnapshot) {
339 throw new Error(
340 `No snapshot found for page ${this.id ?? '?'}. Use ${takeSnapshot.name} to capture one.`,
341 );
342 }
343 const node = this.textSnapshot.idToNode.get(uid);
344 if (!node) {
345 throw new Error(`Element uid "${uid}" not found on page ${this.id}.`);
346 }
347 return this.#resolveElementHandle(node, uid);
348 }
349
350 async #resolveElementHandle(
351 node: TextSnapshotNode,

Callers 6

input.tsFile · 0.80
fillFormElementFunction · 0.80
screenshot.tsFile · 0.80
script.tsFile · 0.80
McpContext.test.tsFile · 0.80

Calls 2

#resolveElementHandleMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected