鼠标悬停

鼠标悬停在某按钮上后显示的界面,需要对这个界面中的元素进行操作。这个怎么做

你可以查一下这个方法
new Actions(driver).moveToElement(driver.findElement(by)).perform();
用这个方法来弹出界面,然后在去做你的操作

//鼠标移到By.xpath("//span[text()='bbb']")这个文本元素上,然后会出现“删除”,

 WebElement element = driver.findElement(By.xpath("//span[text()='bbb']"));
      Actions action = new Actions(driver);
      action.moveToElement(element).perform();
      
      //点删除
      driver.findElement(By.xpath("//a[@title='删除']")).click();
      System.out.println("点删除 OK!");

原文地址:https://www.cnblogs.com/sschen/p/3184345.html