.body.scrollHeight
does not work in Firefox.
See: http://jsfiddle.net/gjrowe/X63KR/
What is the correct syntax to use instead?
.body.scrollHeight
does not work in Firefox.
See: http://jsfiddle.net/gjrowe/X63KR/
What is the correct syntax to use instead?
This question has the same root problem as the thread at... Dynamically define iframe height based on window size (NOT CONTENT)
Understanding the issue at that thread will give the solution to this.
Basically, instead of using .body.scrollHeight
, add this code...
function getDocHeight() {
var D = document;
return Math.max(
Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
Math.max(D.body.clientHeight, D.documentElement.clientHeight)
);
}
The answer was obtained from: http://james.padolsey.com/javascript/get-document-height-cross-browser/
Use below code:
JavascriptExecutor jse = (JavascriptExecutor) (WebDriverObject);
jse.executeScript("window.scrollBy(0,document.body.scrollHeight || document.documentElement.scrollHeight)", "");
` it seems to work – Rodrigo Siqueira Apr 10 '13 at 17:42
` and it seems to increase from 0 but it is not the height of the scrollable area... it seems to be the height of the content. – G-J Apr 10 '13 at 17:44