public class FoodToFoodGroup { driver.findElement(By.xpath("//*[@id='engage-create']//ul[@title='Message']/li")).click();
Thread.sleep(9000);
WebDriverWait wait = new WebDriverWait(driver, 20); WebElement element = wait.until( ExpectedConditions.visibilityOfElementLocated(By.cssSelector("img#accordionIcon.accordionIcon.sprite")));
element.click(); }
我可以点击图片中所示的消息图标,但是鼠标仍指向框架或框架后自身不会消失。所以我无法点击其他元素。 Image
答案 0 :(得分:0)
为什么不将鼠标悬停在不同的元素上,直到该帧消失为止。如果要将鼠标悬停在特定元素上,请使用此方法
public static void hoverToWebelement(WebElement HovertoWebElement) throws InterruptedException {
//log.info("Hovering over an element");
Actions builder = new Actions(driver);
builder.moveToElement(HovertoWebElement).perform();
Thread.sleep(2000);
}