// Scroll to a element (tips: especially useful when elements are invisible or blocked) jse.executeScript("arguments[0].scrollIntoView();", element);
// Scroll down jse.executeScript("window.scrollBy(0, 500)", ""); jse.executeScript("scroll(0, 500);");
// Scroll to buttom jse.executeScript("window.scrollTo(0, document.body.scrollHeight)");
// height of dynamic element double ImageHeight = eachtile.getSize().getHeight(); double f = 1.04*ImageHeight; ((JavascriptExecutor)driver).executeScript("window.scrollBy(0,arguments[0]);", -f);
// Another Solution: // modify attribute to make it visible // tip: I haven't check this solution out yet :) String strJs = "document.getElementsByClassName('arguments[0]').style.height='auto'; document.getElementsByClassName('arguments[0]').style.visibility='visible';";