As part of a test suite measuring FPS for a web application I need to perform a smooth scroll of the web page. That is, the same smoothness as when a user grabs the scroll bar and moves it with the mouse.
So far I have tried by using simulating key presses with sikuli, i.e. pressing the arrow up/down keys multiple times to scroll the whole page. I have also tried using a Javascript approach:
public void scrollSmooth(int durationOfScroll){
long timeWhenStarting = System.currentTimeMillis() / 1000L;
while (System.currentTimeMillis() / 1000L - timeWhenStarting < durationOfScroll) {
((JavascriptExecutor) driver).executeScript("window.scrollBy(0,10)", "");
}
}
Both these approaches fails to fulfill their purpose, as they both generate a step-by-step scroll, which is not suitable when I simultaneously want to measure the FPS (e.g. the smoothnes of the page when scrolling).