Webdriver takes screenshot from viewport not from whole page

193 views
Skip to first unread message

ambi

unread,
Feb 13, 2013, 7:37:38 AM2/13/13
to seleniu...@googlegroups.com
Try to capture screenshot of whole web page - web page is big so that browser contains vertical scrollbar.
However as a result i get only viewport screenshot.
If I try to resize browser windows to smaller one then screenshot also will be smaller.
Also notice that firefoxdriver adds "<canvas id="fxdriver-screenshot-canvas" style="display: none;" width="531" height="589"></canvas>" to html code, here width and height are incorrect.

Tried with several browser: firefox18, chrom24, ie8, opera
Selenium version: 2.29.0
Tried with all possible commonds same result always:
driver.save_screenshot(path_to_image)
driver.get_screenshot_as_file(path_to_image)
driver.get_screenshot_as_base64()

Any solutions or ideas about this problem?
Reply all
Reply to author
Forward
0 new messages