findElement function
Last updated: 2026-03-05T20:45:07.036Z
Metrics
LOC: 24
Complexity: 7
Params: 1
Signature
findElement(step: FlowStep): : Element | null
Source Code
function findElement(step: FlowStep): Element | null {
// Try smart selectors first (ordered by priority)
if (step.smartSelectors?.length) {
for (const ss of step.smartSelectors) {
try {
const el = document.querySelector(ss.value);
if (el) return el;
} catch {
// invalid selector — skip
}
}
}
// Fallback to primary selector
if (step.selector) {
try {
return document.querySelector(step.selector);
} catch {
return null;
}
}
return null;
}
No outgoing dependencies.
Impact (Incoming)
| Source | Type |
|---|---|
| requireElement | calls |
| handleWait | calls |
| handlePressKey | calls |
| handleAssert | calls |
| highlightElement | calls |