selenium定位鼠标悬停的元素。

//创建鼠标属性方法
     Actions action=new Actions(driver);

    // 获取 moveToElement 方法 ,元素定位到想要移上去的元素上 

    action.moveToElement(dr.findElement(By.xpath("//*[@id=\"secmenu_p000\"]/a[2]"))).perform();

 }
 

猜你喜欢

转载自blog.csdn.net/ningmengbu_suan/article/details/107209872