【发布时间】:2016-05-20 01:50:29
【问题描述】:
我的代码在 FF 中运行良好,但如果我尝试使用 IE,它会闪烁。
下面是我的代码
WebElement mouseOver= driver.findElement(By.linkText("abc"));
//I'm finding element by linkText. Selenium find the linktext, Next im using Action class to perform the move.
Actions action = new Actions(driver);
action.moveToElement(mouseOver).build().perform();
Thread.sleep(1000);
一旦触发移动到元素行的动作,它似乎会通过循环或鼠标一直在链接文本“abc”上移动。由于它闪烁它无法移动到下一个元素。我正在使用 thread.sleep,因为在将鼠标悬停到元素后通常会显示其他项目,通常需要大约 1 秒才能出现。
我检查了以下link,声明
发生这种情况的普遍理论是 IE 正在进行命中测试 在其事件循环期间发生某种事件,这导致它响应 物理光标在窗口内时的物理鼠标位置 界限。
这是否意味着悬停在 IE 中不起作用。闪退有什么办法吗?
【问题讨论】:
-
不幸的是,Internet Explorer 的这种已知行为请参阅 [this answer][1] [1]: stackoverflow.com/a/19662445/1943133
标签: javascript jquery html css selenium