Closed andreabisello closed 8 years ago
@jphalip is a bit different. in a simply webpage, screenshot will taken even outside viewport. you can see it with those test
def test_inside_viewport(self):
self.driver.get('https://rawgit.com/abioneperhobby/needle/master/demo/viewport.html')
self.assertScreenshot('#inside', 'inside')
def test_outside_viewport(self):
self.driver.get('https://rawgit.com/abioneperhobby/needle/master/demo/viewport.html')
self.assertScreenshot('#outside', 'outside')
i'm trying to understand what's happening
@jphalip closed, the problem is not the viewport, the problem is the scrollable area. opening https://github.com/bfirsh/needle/issues/53
Hi,
when i use needle to capture screenshot under the current viewport, screenshot becomes black.
for example, if my browser has 1000px of height but the page is scrollable because its body has a height of 2000px, and my target id is in the page, but out of the area the browser can see, the screenshot becomes black.
i attached two screenshot. the test is the same, but i put a time.sleep(10) that permits to me to scroll down in the page obtaining a screenshot
how should i handle this situation?
should i implement a "if not visible scroll browser to makes the div visible" ?