Skip to content

fix: use Selenium Actions for click()#2159

Draft
mcollovati wants to merge 1 commit intomainfrom
issues/2155-fix_click_implementation
Draft

fix: use Selenium Actions for click()#2159
mcollovati wants to merge 1 commit intomainfrom
issues/2155-fix_click_implementation

Conversation

@mcollovati
Copy link
Contributor

TestBenchElement.click() was using JavaScript's element.click(), which does not produce the same browser events as a real user click. This made click() behave differently from click(x, y), doubleClick(), and contextClick(), which all use Selenium Actions and correctly simulate user interactions. Side effects include missing or incorrect browser event properties such as click count.

Replace the default click() implementation with Selenium Actions.click(), consistent with the other click methods. The old JavaScript-based click logic is extracted into a new javascriptClick() method for cases where Selenium cannot reach the element directly.

A useJavascriptClick parameter is added to Parameters for backwards compatibility, allowing existing projects to restore the old behavior via system property or programmatic setter.

Fixes #2155

TestBenchElement.click() was using JavaScript's element.click(), which
does not produce the same browser events as a real user click. This
made click() behave differently from click(x, y), doubleClick(), and
contextClick(), which all use Selenium Actions and correctly simulate
user interactions. Side effects include missing or incorrect browser
event properties such as click count.

Replace the default click() implementation with Selenium
Actions.click(), consistent with the other click methods. The old
JavaScript-based click logic is extracted into a new javascriptClick()
method for cases where Selenium cannot reach the element directly.

A useJavascriptClick parameter is added to Parameters for backwards
compatibility, allowing existing projects to restore the old behavior
via system property or programmatic setter.

Fixes #2155
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.

Incorrect clickCount in ItemClickEvent when using TestBench to click TreeGrid cells

1 participant