Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to automate a Slider in Selenium

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 4.20k
    Comment on it

    The following code should be used to automate the slider:

    WebDriver driver = new FirefoxDriver();
    driver.get("http://jqueryui.com/resources/demos/slider/default.html");
    driver.manage().timeouts().implicitlyWait(20L, TimeUnit.SECONDS);
    WebElement slider = driver.findElement(By.xpath("//*[@id='slider']/a"));
    Actions action = new Actions(driver);
    action.dragAndDropBy(source, xOffset, yOffset).perform();
    

    eg: action.dragAndDropBy(slider, 200, 0).perform();

    source element to emulate button down at.
    xOffset horizontal move offset.
    yOffset vertical move offset.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: