selenium webdriver 模拟鼠标悬浮

    /**模拟鼠标悬浮在某元素上
     * @param driver
     * @param locator
     */
    public static void moveToElement(WebDriver driver, By locator) {
        Actions builder = new Actions(driver);
        builder.moveToElement(driver.findElement(locator)).perform();
    }

 http://www.51testing.com/html/18/631118-861557.html

//悬浮到上方点击

        builder.moveToElement(e);
        builder.click().perform();

posted @ 2013-08-24 16:55  苦逼IT男  阅读(4208)  评论(0编辑  收藏  举报