这个问题在这里已经有了答案:
9年前关闭。
Possible Duplicate:
How to move Horizontal Slider or Vertical Slider of jQuery using Selenium Webdriver
互联网上有很多 slider 的例子,比如
http://jqueryui.com/demos/slider/
是否可以使用 Selenium 移动 slider ?
最佳答案
工作代码-
WebDriver driver = new InternetExplorerDriver();
driver.get("http://jqueryui.com/demos/slider/");
//Identify WebElement
WebElement slider = driver.findElement(By.xpath("//div[@id='slider']/a"));
//Using Action Class
Actions move = new Actions(driver);
Action action = move.dragAndDropBy(slider, 30, 0).build();
action.perform();
driver.quit();
来源 - https://gist.github.com/2497551
关于selenium - Selenium 中可以进行 slider 移动吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12122824/