How to slide{move} slider in Selenium WebDriver

后端 未结 11 2017
花落未央
花落未央 2021-02-11 09:30

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:

         


        
11条回答
  •  有刺的猬
    2021-02-11 10:34

    Use the below method to forwarding and Reverse seek on player
    
    
    public void dragByPixelElement(WebElement element, int x, int y) {
    
    WebElement element = driver.findElements(By.xpath("sliderPointXpath"));
            Actions act = new Actions(driver);
            act.dragAndDropBy(element, 200, 500).perform();
    
        }
    
    For forward seek use positive x value and for reverse seek use negative value as I used in this code :) 
    

提交回复
热议问题