FirefoxDriver 无法正确处理点击
有人解决这个问题了吗?
每当我有提交按钮时,我都必须采取解决方法并向其发送“Enter”键。更具体地说:
WebDriver driver = new FirefoxDriver();
driver.get("my-test-site");
WebElement confirmBid = driver.findElement(By.id("mainForm:aucPanelId:1:finishEditBid"));
confirmBid.click();
不起作用,什么也没有发生,价值未得到确认。但是,如果我将最后一个更改为:
Keys enter = Keys.ENTER;
confirmBid.sendKeys(enter.toString());
工作正常并且表单已提交。
但是,click(); 命令在链接上运行良好。
知道为什么会这样吗?
has anyone solved this?
Whenever I have submit button, I have to go in workaround and send keys "Enter" to it. To be more specific:
WebDriver driver = new FirefoxDriver();
driver.get("my-test-site");
WebElement confirmBid = driver.findElement(By.id("mainForm:aucPanelId:1:finishEditBid"));
confirmBid.click();
does not work, nothing happens, value is not confirmed. However, if I change the last to:
Keys enter = Keys.ENTER;
confirmBid.sendKeys(enter.toString());
Works fine and the form is submitted.
However, the click(); command works fine on links.
Any idea why is that like this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己有时也遇到过一些问题。不知道为什么会发生这种情况,但你可以使用...
让它更干净一点。
I have had some problems with that myself at times. Not sure why it happens but you can use...
to make it a little cleaner.