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 27920 - [WebDriver Spec]: takeScreenshot is a GET but what about screenshots of elements??
Summary: [WebDriver Spec]: takeScreenshot is a GET but what about screenshots of eleme...
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: Browser Testing and Tools WG
QA Contact: Browser Testing and Tools WG
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 20860
  Show dependency treegraph
 
Reported: 2015-01-28 23:27 UTC by David Burns :automatedtester
Modified: 2015-06-10 22:29 UTC (History)
5 users (show)

See Also:


Attachments

Description David Burns :automatedtester 2015-01-28 23:27:40 UTC
When ripping out webIDL I noticed that in takeScreenshot is a GET which aligns with the OSS Project implementation[1].

We also have the ability now to take screenshots of elements. This will either need to be a POST of the current url endpoint (yuck in my opinion) or a completely new endpoint. I propose we using

GET /session/{sessionId}/screenshot/{ELEMENT}

instead of changing the original call to POST.

Thoughts?
Comment 1 Marc Fisher 2015-01-28 23:41:50 UTC
For consistency with other element-level operations I think:

GET /session/{sessionId}/element/{element}/screenshot

makes the most sense as an endpoint.
Comment 2 James Graham 2015-01-29 14:51:13 UTC
Yes, I think Marc is correct.
Comment 3 David Burns :automatedtester 2015-01-29 15:46:01 UTC
landed in 9cbf052
Comment 5 seva 2015-03-13 07:13:52 UTC
Spec text still says 'Leaving below until Bug 27920 has a consensus'
Comment 6 John Jansen 2015-06-10 22:06:02 UTC
I do think we have consensus on this, but the spec just needs to change to match it. Marc's proposal makes a lot of sense.
Comment 7 James Graham 2015-06-10 22:28:01 UTC
Apart from the fact that the spec text here needs some work, I don't think there is an actual issue. https://w3c.github.io/webdriver/webdriver-spec.html#element exists.
Comment 8 James Graham 2015-06-10 22:29:12 UTC
Oh unless you mean that the URL is still wrong. But it's just as quick to fix that as discuss it here; I'll make a PR.