This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24364 - Define what the capture area is on takeScreenshot
Summary: Define what the capture area is on takeScreenshot
Status: RESOLVED FIXED
Alias: None
Product: Browser Test/Tools WG
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: David Burns :automatedtester
QA Contact: Browser Testing and Tools WG
URL:
Whiteboard:
Keywords:
: 25692 (view as bug list)
Depends on:
Blocks: 20860
  Show dependency treegraph
 
Reported: 2014-01-22 17:02 UTC by Andreas Tolfsen
Modified: 2014-09-07 12:03 UTC (History)
4 users (show)

See Also:


Attachments

Description Andreas Tolfsen 2014-01-22 17:02:50 UTC
The wording of the takeScreenshot command isn't great, and it currently doesn't define which area of the screen to capture when not given an explicit web element reference.

Selenium uses a prioritized list of preferred things to capture:

    http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/TakesScreenshot.html

This isn't great and we should mandate something the browsers should do, which can be one of the following I guess:

  - Browser window including chrome
  - Visible viewport
  - Canvas of bounding box of the document of the top-level browsing context
Comment 1 Andreas Tolfsen 2014-01-22 17:03:24 UTC
An interesting question, I find, is whether the last point can be replaced by doing (pseudo code) driver.find_element_by_css(":root").take_screenshot(), which would send the web element reference ID of ":root" as an argument to takeScreenshot.

If we're happy with that we could have takeScreenshot without arguments just do the visible viewport or the browser window.
Comment 2 David Burns :automatedtester 2014-06-30 22:07:06 UTC
*** Bug 25692 has been marked as a duplicate of this bug. ***
Comment 3 David Burns :automatedtester 2014-07-01 21:57:53 UTC
Initial implementation in https://dvcs.w3.org/hg/webdriver/rev/e4451afd6d71
Comment 4 David Burns :automatedtester 2014-09-07 12:03:43 UTC
Seeing as no comments have been added (and I am sure there are other errors so raise a new bug for those) I am closing this bug