selenium web驱动程序鼠标悬停在IE 8中无法正常工作

selenium web驱动程序鼠标悬停在IE 8中无法正常工作,selenium,selenium-webdriver,selenium-ide,Selenium,Selenium Webdriver,Selenium Ide,在我尝试点击“关于我们”>“香料路线杂志”的链接“2016年2月”,下面是我使用的脚本。有两个问题: 1) 该脚本在firefox中运行良好,但在IE中却不行。为什么?(在IE中,菜单一直在闪烁,即使在我设置的30秒隐式等待之后,它也不会为我们计时) 2) 即使在firefox中,该脚本也只适用于Thread.sleep,而不适用于条件等待。为什么? 代码: 点击“关于我们” 鼠标悬停在“香料路线杂志”上 鼠标悬停并点击“2016年2月” 在每次鼠标悬停之间使用Thread.sleep(5000

在我尝试点击“关于我们”>“香料路线杂志”的链接“2016年2月”,下面是我使用的脚本。有两个问题: 1) 该脚本在firefox中运行良好,但在IE中却不行。为什么?(在IE中,菜单一直在闪烁,即使在我设置的30秒隐式等待之后,它也不会为我们计时) 2) 即使在firefox中,该脚本也只适用于Thread.sleep,而不适用于条件等待。为什么?

代码: 点击“关于我们”

鼠标悬停在“香料路线杂志”上

鼠标悬停并点击“2016年2月”

在每次鼠标悬停之间使用
Thread.sleep(5000)
时,上述代码在firefox中运行良好。但是使用条件等待,比如
owait.until(ExpectedConditions.visibilityOf(wDriver.findelelement)(By.xpath(“/*[@id='smoothmenu1']]/ul/li[2]/ul/li[5]/a”)等待“Spice Route Magazine”的可见性和等待时间(预期条件.可见性(wDriver.findElement(By.xpath(“/*[@id='smoothmenu1']]/ul/li[2]/ul/li[5]/ul/li[1]/a”))等待“2016年2月”的可见性,它不工作


我也尝试了不同的链接文本定位器,但没有用。请提供帮助。

在谷歌搜索了一段时间后,在初始化之前对IE驱动程序进行了以下设置,我让它开始工作:

DesiredCapabilities capab = DesiredCapabilities.internetExplorer();
capab.setCapability(InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING,false);
capab.setCapability(InternetExplorerDriver.NATIVE_EVENTS,false);
wDriver = new InternetExplorerDriver(capab);
我的第二个问题仍然没有答案

mAction.moveToElement(wDriver.findElement(By.xpath("//*[@id='smoothmenu1']/ul/li[2]/ul/li[5]/a"))).build().perform();
mAction.moveToElement(wDriver.findElement(By.xpath("//*[@id='smoothmenu1']/ul/li[2]/ul/li[5]/ul/li[1]/a"))).click().build().perform();
DesiredCapabilities capab = DesiredCapabilities.internetExplorer();
capab.setCapability(InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING,false);
capab.setCapability(InternetExplorerDriver.NATIVE_EVENTS,false);
wDriver = new InternetExplorerDriver(capab);