使用 Selenium 使用 sendKeys() 时,大写字母被重新排列/交换
我使用硒和Chromedriver遇到了问题。 使用sendkeys()
带有首都的方法时,字母会重新排列。 例如,我使用:
element.sendKeys("ABCD")`
但是在运行时,它发送了“ CDAB”字符串。
到目前为止,我使用这种方法,它只会发生在首都。
有人知道原因吗?
I've faced a problem using Selenium and chromedriver.
When using sendKeys()
method with capitals, letters are rearranged.
For example, I use:
element.sendKeys("ABCD")`
but in runtime it sends "CDAB" string.
As far I played with this method, it happens only with CAPITALS.
Does anyone know the reason why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
元素的基于文本的 HTML 将有助于以更好的方式调试问题。
但是,始终建议将字符序列发送到任何
字段,您需要引入 WebDriver等待到elementToBeClickable() 用于要渲染的元素 > 完全可以使用以下解决方案:
The text based HTML of the element would have been helpful to debug the issue in a better way.
However, it is always recommened that to send a character sequence to any
<input>
field you need to induce WebDriverWait to elementToBeClickable() for the element to render completely and you can use the following solution: