如何Selenium WebDriver在Java中使用自動化拖放功能?
3 回答

千巷貓影
TA貢獻1829條經驗 獲得超7個贊
拖放可以像這樣實現...
public ObjectPage filter(int lowerThreshold, int highThreshold) {
Actions action = new Actions(getWebDriver());
action.dragAndDropBy(findElement(".className .thumbMin"), lowerThreshold, 0).perform();
waitFor(elementIsNotDisplayed("#waiting_dialog"));
action.dragAndDropBy(findElement(".className .thumbMax"), highThreshold, 0).perform();
waitFor(elementIsNotDisplayed("#waiting_dialog"));
return this;
}
希望有幫助!
添加回答
舉報
0/150
提交
取消