Skip to content

[java] allow setting a different keyboard or pointer for actions on i… #10213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 10, 2022

Conversation

titusfortner
Copy link
Member

You can see how difficult it is to work with an input device that isn't a default keyboard or a default mouse in the tests I wrote for a pointer.

Using a setActivePointer() / setActiveKeyboard is one way of making this easier. I was looking at different options like putting it in the constructor, but then you'd need 8 different constructors when we add in wheel support soon.

The Actions class does a good job of adding Pauses where needed for newly seen inputs already, but something does not like 2 different objects being given the same name, so we need to re-use the existing input object if it is there rather than creating a new one.

The implementation can probably be improved.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine to me, and tests will look more simple.

I will wait for the CI to finish and see if something fails related to this change.

@diemol diemol merged commit 3e2c016 into SeleniumHQ:trunk Jan 10, 2022
elgatov pushed a commit to elgatov/selenium that referenced this pull request Jun 27, 2022
…nput devices (SeleniumHQ#10213)

Co-authored-by: Puja Jagani <puja.jagani93@gmail.com>
Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
@titusfortner titusfortner deleted the java_inputs_setter branch December 4, 2022 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants