如何在水平进度条URL上滑动滑块:http://jqueryui.com/slider/ 我试图滚动滑块但它对我不起作用.我使用Java的代码如下:
public class TestClass
{
public static void main(String[] args) {
File file = new File("D:\\Driver\\IEDriverServer.exe");
System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
WebDriver driver = new InternetExplorerDriver();
driver.get("http://jqueryui.com/slider/");
WebElement slider = driver.findElement(By.xpath("//div[@id='slider']/a"));
Actions move = new Actions(driver);
Action action = (Action) move.dragAndDropBy(slider, 30, 0).build();
((Actions) action).perform();
}
}
Run Code Online (Sandbox Code Playgroud)
安慰
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with css selector == html body div#slider.ui-slider a.ui-slider-handle (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 286 …Run Code Online (Sandbox Code Playgroud)