ouniao

首页 新随笔 联系 订阅 管理

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

你可以查一下这个方法
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!");

posted on 2013-07-11 17:16  ouniao  阅读(382)  评论(0编辑  收藏  举报