vendredi 13 février 2015

how to write JavaScript in selenium to continuous loading of the page up to end


How to write Javascript for continuous page loading up to end of the page if we use scroll bar.If the page is loaded, 20 friends are getting displayed on the page and if I scroll down to bottom another 20 friends are getting displayed, to load all the friends i have to scroll down to bottom.I used below scripts for scroll down the web page but did not get accurate results.Could you please tell the java script for this scenario



((JavascriptExecutor) driver)
.executeScript("window.scrollTo(0, document.body.scrollHeight)");

JavascriptExecutor js=(JavascriptExecutor)driver;
js.executeScript("window.scrollTo(0,5000)");


Example to know the scenario Facebook friends list in the Facebook account.





Aucun commentaire:

Enregistrer un commentaire