Skip to content

How to use WHOLE_PAGE with scrollable div? #79

@roboaks

Description

@roboaks

We are using Shutterbug with a system that uses a popular UI framework where the bulk of the screen is within a scrollable div (styled with overflow-y: scroll). We primarily using Chrome but need to support Firefox as well. The problem appears to be centered within Shutterbug's
takeScreenshotEntirePageUsingChromeCommand method and, in particular, within this code:

 int verticalIterations = (int) Math.ceil(((double) this.getDocHeight()) / this.getViewportHeight());
        for (int j = 0; j < verticalIterations; j++) {
            this.scrollTo(0, j * this.getViewportHeight());
            wait(scrollTimeout);
        }

Since this method operates on the browser window itself, not any particular scrollable element, verticalIterations is calculated improperly and this.scrollTo simply scrolls the window to take the whole page screenshot.

Is there a solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions