How to slide slider on horizontal progress bar URL: http://jqueryui.com/slider/ I tried to scroll the slider but it did not work for me. My code using Java is below:
I just tried another way to work on slider bar.
My code:
public void sliderCode(int iSliderAdjustValue){
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/");
WebDriver driver = new InternetExplorerDriver();
driver.get("http://jqueryui.com/slider/");
driver.switchTo().frame(0); //need to switch to this frame before clicking the slider
WebElement slider = driver.findElement(By.xpath("//div[@id='slider']/a"));
Actions builder= new Actions(driver);
int iCount = 0;
if (iRange > 0) {
for(iCount = 0; iCount < iRange; iCount++) {
builder.moveToElement(slider).click(slider).sendKeys(Keys.ARROW_UP).perform();
}
} else {
for (iCount = 0; iCount > iRange; iCount--) {
builder.click(slider).sendKeys(Keys.ARROW_DOWN) .perform();
}
}
}