Skip to content

Unable to take a screenshot of a fully loaded page #893

Open
@gsnedders

Description

@gsnedders

At the moment, with WebDriver, you can trivially wait until after the load event has fired before taking a screenshot. However, not everything delays the load event (see HTML's notion of "critical subresources" and "delays the load event"). Anything you can detect whether or not it has loaded using the DOM can equally be dealt with through the script APIs.

However, CSS is especially awkward because of w3c/csswg-drafts#1088. At the moment, Edge doesn't block the load event on background-image and list-style-image and these are undetectable through the DOM.

We need some proper solution to this problem in a general sense. As a web developer, to do any sort of visual testing, you want to be able to take a screenshot of a page after everything has loaded (of course, this can get complicated by long polling XHR, WebSockets, etc.).

I think there's at least a couple of options options:

  • Convince everyone (WGs, implementers) that the page should be in a stable state after the load event has fired
  • Add some custom notion to WebDriver of loadedness (OperaDriver has something like this with opera.idle)

Notably, this is causing problems for wptrunner running reftests, as we need some way to take a screenshot after everything has loaded. (web-platform-tests/wpt#5412)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions