Selenium sendkeys drops character with Chrome Driver(Selenium sendkeys 使用 Chrome 驱动程序丢弃字符)
问题描述
带有 Chrome 驱动程序的 Selenium sendkey 会丢弃字符2"和4".其他字符正常.当我使用其他浏览器(IE 或 FF)时,一切正常.
Selenium sendkeys with Chrome Driver drops character "2" and "4". Other characters are OK. When I use other browser (IE or FF), everything is OK.
代码:
WebElement name = driver.findElement(localizator);
name.clear();
name.sendKeys("1234567890 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ");
结果:输入框被填满
13567890 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
字符2和4缺失,其他字符填写正确.
Characters 2 and 4 are missing, other characters are filled correctly.
我使用的是 Windows 7 64bit,Chrome 版本 29.0.1547.57 m,ChromeDriver win32 (v2.2.215849.dyu) - 最新版本.
I use Windows 7 64bit, Chrome version 29.0.1547.57 m, ChromeDriver win32 (v2.2.215849.dyu) - the newest one.
推荐答案
调查你也来自捷克共和国,我会做出疯狂的假设,你的键盘默认设置为捷克语.
Investigating you are from Czech Republic also, I am going to make wild assumption, that your keyboard is set up to Czech as default.
当我的系统默认使用捷克语键盘时,sendKeys 也有一些奇怪的问题.由于我将默认设置更改为英文,问题就消失了.
I also had some strange issues with sendKeys when my system had Czech keyboard as default one. Since I changed default to English, the problems dissapeared.
如果这没有帮助,请提供信息,如果您尝试这样做会发生什么:
If this does not help, please provide info what is going to happen if you try this:
name.sendKeys("2");
name.sendKeys("22222222");
name.sendKeys("4");
name.sendKeys("44444444");
name.sendKeys("424242");
这篇关于Selenium sendkeys 使用 Chrome 驱动程序丢弃字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Selenium sendkeys 使用 Chrome 驱动程序丢弃字符
基础教程推荐
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 如何对 Java Hashmap 中的值求和 2022-01-01
