You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[js] link text TypeScript locator matches links that are not rendered #18215
The TypeScript link-text locator reads a link's text with innerText. For an element that is not rendered (for example display:none), innerText falls back to the text content. So a hidden link can match an exact or partial link-text search, and the caller can get a different element back. The Closure locator used bot.dom.getVisibleText, which returns an empty string for hidden elements.
This was already on trunk in javascript/atoms/typescript/find-elements.ts (innerText ?? textContent). #18175 moved it unchanged into core/locators.ts (getLinkText). Qodo raised it there: #18175 (comment)
Suggested fix: when the link is not shown, treat its text as empty, keeping the normalisation and the trim. Add exact and partial link-text tests against a display:none link.
Activity
[js] Ignore hidden links in TypeScript link text locators
[js] Ignore hidden links in TypeScript link text locators
[js] Ignore hidden links in TypeScript link text locators
[js] Ignore hidden links in TypeScript link text locators (SeleniumHQ…