-1

I am using Selenium with LISA. We have to scroll down to the page bottom,i tried all the selenium+java codes, but not working. I'm using chrome driver .using the below code

JavascriptExecutor je = (JavascriptExecutor) dr;  
     je.executeScript("arguments[0].scrollIntoView(true);", 
dr.findElement(By.partialLinkText("Mail")));
Paolo Forgia
  • 6,572
  • 8
  • 46
  • 58
Mallik
  • 679
  • 2
  • 14
  • 18
  • Have a look at this http://stackoverflow.com/questions/12293158/page-scroll-up-or-down-in-selenium-webdriver-selenium-2-using-java – Siva Aug 17 '16 at 06:41

1 Answers1

1

scrollIntoView(true); method scrolls to the current element which is arguments[0] into the visible area of the browser window while you want to scrolling down of the page, so you should try as below :-

JavascriptExecutor je = (JavascriptExecutor) dr;
je.executeScript("window.scrollTo(0,document.body.scrollHeight);")

dr.findElement(By.partialLinkText("Mail")));
Saurabh Gaur
  • 23,507
  • 10
  • 54
  • 73