Skip to content

Remove per lookup match scan (1.1.0) - #10

Merged
godhiraj-code merged 1 commit into
mainfrom
fix/find-element-perf-1.1.0
Oct 24, 2026
Merged

godhiraj-code merged 1 commit into
mainfrom
fix/find-element-perf-1.1.0

Conversation

@godhiraj-code

Copy link
Copy Markdown
Owner

What this fixes

After PR #9, every wrapped find_element() also called find_elements() with the same locator and passed every match into the fingerprint script to record the element's index. That cost grew with the number of matches (about 0.37 to 0.41 s per lookup for a selector matching 2000 elements in my local measurement on 77e0de7). The index never added identity information: find_element() and the stale retry both take the first match, so it was always 0.

Changes

  • Fingerprint is now tag, visible text, id, name, data-testid, aria-label, and the parent's visible text (both capped at 200 characters), read in one script call. No scan of all locator matches during find_element() or the stale retry.
  • Elements from find_elements() or scripts no longer read a fingerprint on successful clicks. Only when the enabled wait times out does one diagnostic script read add the tag and text to the error.
  • README: documents that a change in the parent's text (for example Cart (1) to Cart (2)) makes the stale retry refuse, and that a specific locator does not bypass that check.
  • CHANGELOG 1.1.0 entries updated to match.
  • Tests: unit and browser regressions for the removed scan, the lazy diagnostics and the parent text refusal.

Not done

Not merged, tagged, released or published. 1.1.0 is still unreleased.

@godhiraj-code
godhiraj-code merged commit 5bd2aed into main Oct 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant