MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / idMany

Function idMany

javascript/atoms/typescript/find-elements.ts:61–73  ·  view source on GitHub ↗
(target: string, root: Root)

Source from the content-addressed store, hash-verified

59 }
60
61 function idMany(target: string, root: Root): Element[] {
62 if (!target) {
63 return []
64 }
65 if (!/^\d/.test(target)) {
66 try {
67 return Array.from(root.querySelectorAll('#' + cssEscapeId(target)))
68 } catch (_e) {
69 return []
70 }
71 }
72 return Array.from(root.querySelectorAll('*')).filter(el => el.getAttribute('id') === target)
73 }
74
75 function getLinkText(el: Element): string {
76 const text = (el as HTMLElement).innerText !== undefined ? (el as HTMLElement).innerText : el.textContent || ''

Callers 1

find-elements.tsFile · 0.85

Calls 5

cssEscapeIdFunction · 0.85
filterMethod · 0.80
getAttributeMethod · 0.65
testMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected