-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
SendKeys() behavior is inconsistent and broken - often moving focus to the end of an input value erroneously #2141
Comments
Could you please attach a trace-level log from geckodriver? |
@whimboo I tried but I've not been able to get them. I set the log level to Trace on my FirefoxOptions but nothing relevant is being printed to standard out. I am using Selenium docker with a Selenium Hub and then (among others) a Firefox node. Was looking at the logs on the FF node and I'm not seeing anything from the geckodriver there? Only seeing:
|
Hm, we have seen similar issues with C# recently, and maybe something changed in Selenium in how to generate the logs. Maybe you could ask there for some hint? Also can you reproduce this problem locally as well? |
@whimboo Apologies for the wait. I can't use Firefox locally at work so had to wait until I got home where I can't use the actual code I wrote at work so had to write some quick rubbish to replicate it.... Was able to replicate the same issue running against a local geckodriver. So running this terrible code:
This resulted in the value of the input being "Some text to enterSome different text value". It should of course be "Some different text value" as it would be if you manually performed the actions. I get the logs pasted in below. Not sure why they are all 'DEBUG' level? As you can see in the code above I set the level to 'TRACE'. 1698269655294 geckodriver::marionette DEBUG Connection to Marionette established on 127.0.0.1:49495. |
System
Testcase
I have a text input that has some contents. I am intending to overwrite its value with a new value:
But it is not behaving as it should. This should highlight the existing text (its single line input rather than text area if that matters) and then type the new value thus overwriting the highlighted existing value. What tends to happen though is that focus moves to the end of the existing input value before it then types the new one. This code works as intended on Chromium. Have tried a few other way including using the DEL key to delete the highlighted text, Ctrl+ A to highlight instead etc. but result is the same. The behaviour doesn't even appear to be deterministic, it works 50% of the time if the existing value is just alpha numeric characters. However if there are '-' in there is never works fully, sometimes it will highlight a portion up to the next hyphen (rather than the full value) and other times it will just stick the new value on the end.
The text was updated successfully, but these errors were encountered: