Does anyone know how I can do Scroll in Selenium Webdriver in JAVA

0

Code:

WebElement emailsecundario = driver.findElement(By.id("RecoveryEmailAddress"));
emailsecundario.sendKeys(" [email protected]");        

WebElement gravar = driver.findElement(By.id("submitbutton"));
gravar.click();

Does anyone know how I can do Scroll in Selenium Webdriver in Java?

    
asked by anonymous 25.07.2017 / 19:01

1 answer

0

Scrolling down :

WebDriver driver = new FirefoxDriver();
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript("scrollBy(0,250)", "");

Scrolling Up :

jse.executeScript("scroll(0, -250);");

    
25.07.2017 / 20:04