我正在尝试使用此代码将 key 发送到浏览器(而不是元素):
Actions action = new Actions(driver);
action.sendKeys("Hello! World!");
action.perform();
它在 Chrome 和 IE8 中运行良好,但在 Firefox 中得到结果 World
!
我正在使用 Firefox 22 和 Selenium WebDriver 2.32.0
这是一个错误吗?谢谢。
最佳答案
直到 Selenium 2.34.0 才支持 Firefox 22(目前可能适用于某些场景,但一般来说它不起作用)。
如果你想让 Selenium 2.32.0 工作,我建议回滚到 FF20,如果你想升级到 Selenium 2.33.0,我建议回滚到 FF21。
关于selenium - WebDriver - 向浏览器发送 key 在 Firefox 中不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17784030/