-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
WebElementFacadeImpl.clear method does not work properly #2038
Comments
Could you propose a PR? |
@wakaleo I can try, but I'm not sure I will be able to do it. I will need some hint at least how to start. |
Yeah, knowing the remote OS in a general case would be very tricky. Maybe find another general way to clear a text field? I suspect the current approach was done because the intuitive approach (eg use clear()m) doesn’t work. |
proposal 1: proposal 2:
It would be better to find some nicer solution, but if it is not possible to get easily target OS type then I don't know how to do it. |
Knowing the target OS will depend on the remote server being used, so does not seem possible in a general case. I think ugly solution #2 would be the least worse. |
Hi @wakaleo, Noticed today serenity clear method implementation stopped working for me and my colleagues in Chrome 97+ Had to switch to the following to resolve the issue: Wonder if you or anyone else experienced the same? |
I noticed this today too - I'll push a fix in the next release. |
Fixed in 3.2.0 |
Hi @wakaleo, sorry to hijack this, but I think it may be related... in commit you have removed the element content clearing workaround in WebElementFacadeImpl (lines 1274-1276) stating that it's no longer needed. I have recently run into issue with this, that the .clear() method doesn't really work without this, so I had to add the workaround to my code. Is that expected? |
Dunno, I don't do mobile. Feel free to put it back with a PR if it is needed. |
Thanks for your quick reply. |
There were some changes made recently in clear method in #1788, but I guess it still does not work as expected, because when the test is running locally e.g. under Mac but against Selenium Grid hub or against Browserstack and target OS is different e.g. Windows then incorrect shortcut is used for selecting all text and the result of clear method is that key 'a' is entered into text field.
So I guess this clear method should not check local OS type but target OS type to distinguish which shortcut combination should be used.
Tested using version 2.2.1
The text was updated successfully, but these errors were encountered: