selenium模擬鍵盤操作:
import org.openqa.selenium.interactions.Actions;
Actions action = new Actions(driver);
action.sendKeys(Keys.END).perform();//下拉到底部
action.sendKeys(Keys.HOME).perform();//上拉到頂部
action.sendKeys(Keys.PAGE_DOWN).perform();//向下滾動
action.sendKeys(Keys.PAGE_UP).perform();//向上滾動