Skip to content
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

$.clear() works incorrectly in Safari browser #1819

Closed
asolntsev opened this issue May 27, 2022 · 0 comments · Fixed by #1820
Closed

$.clear() works incorrectly in Safari browser #1819

asolntsev opened this issue May 27, 2022 · 0 comments · Fixed by #1820
Assignees
Labels
Milestone

Comments

@asolntsev
Copy link
Member

The problem

Starting from Selenide 4.5.0, method $.clear() works differently. It doesn't call WebElement.clear() anymore, but executes "Home -> Shift+End -> Backspace".

It doesn't work properly in Safari. Instead of deleting all characters, it deletes only the last one.

Tell us about your environment

  • Selenide Version: 4.5.1

Code to reproduce the problem:

input.setValue("456");
input.setValue("789");
input.clear();
assertThat(input.getValue()).isEqualTo("");  // FAILS - expected: "" but was: "4578"
@asolntsev asolntsev self-assigned this May 27, 2022
@asolntsev asolntsev added this to the 6.6.0 milestone May 27, 2022
asolntsev added a commit that referenced this issue May 27, 2022
For some reason, the combination "Home -> Shift+End -> Backspace" doesn't work in Safari (it doesn't select the text and deletes only the last character). I also could not find any other key combination that would clear the input.

That's why I decided to use the old WebElement.clear() method in Safari. It means that $.clear() will not work for VueJS/React/... based UIs (see issue #1497).
@asolntsev asolntsev linked a pull request May 27, 2022 that will close this issue
asolntsev added a commit that referenced this issue May 28, 2022
For some reason, the combination "Home -> Shift+End -> Backspace" doesn't work in Safari (it doesn't select the text and deletes only the last character). I also could not find any other key combination that would clear the input.

That's why I decided to use the old WebElement.clear() method in Safari. It means that $.clear() will not work for VueJS/React/... based UIs (see issue #1497).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant