fullpage screenshot, I need to know content height when I don't know how many elements have scrollbar.
traverse the node tree to find scrollable elements(maybe div or others) with code below, by sum all scrollHeight I can set the selenium webdriver's window size then do screenshot.
if (node.scrollHeight > node.clientHeight) {
return node;
}
Is there any example or more efficient way to do the fullpage screenshot in selenium?
I've tried html2canvas, with some problems like bg and font difference so gave it up.
This can be answered by:
How to get screenshot of full webpage using Selenium and Java?
Look for the comment related to AShot if you want a full page screenshot.