How to automate scroll up or down button in selenium java
WebDriver driver = new FirefoxDriver();
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript("window.scrollBy(0,250)", "");
or, you can do as follows:
jse.executeScript("scroll(0, 250);”);
If you want to do up use this script.
For scroll up: jse.executeScript("scroll(250, 0)");
Subscribe to:
Post Comments (Atom)
I am working on website which requires me to go to the paypal site to purchase sumthing. However when i reach the paypal site, i am not able to get any element or click on even the login button. Please help. I am using webdriver in java language.
ReplyDelete