How to scroll tables using selenium WebDriver and Java | Selenium Practice
Hello Dear Friends,
I hope you are doing Good.!!
In this tutorial we are going to see a very interesting topic and this is How to scroll tables using selenium WebDriver and Java | Selenium Practice.
To Scroll Down:
import org.openqa.selenium.JavascriptExecutor;
WebDriver driver = new ChromeDriver();
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("scroll(0, 500)"); //y value '250' can be changed
To Scroll Up:
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("scroll(500, 0)"); //x value '500' can be changed
To Scroll Bottom of the Page:
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("window.scrollTo(0,Math.max(document.documentElement.scrollHeight,document.body.scrollHeight,document.documentElement.clientHeight))");
Please visit on our other platforms: 👇
Blog Site : https://socialtechhelpline.blogspot.com
Facebook Channel : https://fb.me/socialtechhelpline
Instagram Channel : https://www.instagram.com/jobsmails18
Comments
Post a Comment