【发布时间】:2016-02-15 08:40:40
【问题描述】:
我已使用以下代码将鼠标悬停在选项卡中并选择表中的菜单。 鼠标悬停在 Firefox 上运行良好,但在 Chrome 和 Internet Explorer 上无法运行。 在选择菜单之前,我们已经选择了 iframe。 请建议在 IE WebDriver 中处理鼠标悬停的替代方法 我已使用操作方法进行鼠标悬停。
action = new Actions(driver);
action.moveToElement(landingpage).perform();
landingpage.click();
System.out.println(" menu tab is clicked on FF" ); driver.manage().timeouts().implicitlyWait(20,TimeUnit.SECONDS);
WebElement tabLinkff = driver.findElement(By.xpath(".//*[@id='mainmenu.service']/li/ul[1]/li/ul[3]/li[2]/a"));
if(tabLinkff.isEnabled()) {
System.out.println("work corner is identified");
tabLinkff.click();
}
【问题讨论】:
-
以正确的方式编辑您的问题:仅对您的代码使用
code sample编辑 -
你用的代码在哪里?
-
action = new Actions(driver); action.moveToElement(landingpage).perform();登陆页面.click(); System.out.println("菜单选项卡在FF上被点击"); driver.manage().timeouts().implicitlyWait(20,TimeUnit.SECONDS); WebElement tabLinkff = driver.findElement(By.xpath(".//*[@id='mainmenu.service']/li/ul[1]/li/ul[3]/li[2]/a")) ; if(tabLinkff.isEnabled()) { System.out.println("工作角已识别"); tabLinkff.click();}
-
从 cmets 添加代码,格式化。
标签: selenium