Actions 动作集

时间:2023-03-09 06:01:38
Actions 动作集

--> 移动鼠标到指定位置(先触发onMouseOver动作)
        Actions action = new Actions(driver);
        WebElement theRow = page.getInvisibleElement();
        action.moveToElement(theRow).perform();
        page.getInvisibleElement().click();

--> Ctrl + LeftClick(组合动作)
        Actions action = new Actions(driver);
        action.keyDown(Keys.CONTROL).perform();
        input.click();// WebElement
        action.keyUp(Keys.CONTROL).perform();