Skip to content

PrintOptions.AddPageToPrint and AddPageRangeToPrint do nothing #9755

@bworline

Description

@bworline

🐛 Bug Report

AddPageToPrint and AddPageRangeToPrint set the internal PrintOptions.pageRanges member.
PrintOptions.ToDictionary, used to serialize PrintOptions to send to the browser, does nothing with the pageRanges. The code literally looks like this, with nothing in between the braces:

...
if (pageRanges.Count > 0)
{
}
...

To Reproduce

C# code like this does nothing to filter pages:

        var printOptions = new PrintOptions();
        printOptions.AddPageRangeToPrint("2-4");
        var printDoc = driver.Print(printOptions);
        printDoc.SaveAsFile("out.pdf");

Expected behavior

I expect the printed pages to be filtered.

Test script or set of commands reproducing this issue

See repro steps above

Environment

OS: Win10
Browser: Edge
Browser version: 92.0.902.78
Browser Driver version: 92.0.902.78
Language Bindings version: ?
Selenium Grid version (if applicable): n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions