Skip to content

[🐛 Bug]: [dotnet] Null check on ISupportsPrint.Print is different from parameter name #14784

Closed as not planned

Description

@RenderMichael

What happened?

ISupportsPrint.Print(options: null); // <- throws parameter 'printOptions' is null

How can we reproduce the issue?

WebDriver driver = new ChromeDriver();
((ISupportsPrint)driver).Print(options: null); // <- throws parameter 'printOptions' is null

Relevant log output

N/A

Operating System

Windows 11

Selenium version

.NET nightly

What are the browser(s) and version(s) where you see this issue?

N/A

What are the browser driver(s) and version(s) where you see this issue?

N/A

Are you using Selenium Grid?

No

Activity

  1. github-actions commented on Nov 20, 2024

    @github-actions
    Contributor

    @RenderMichael, thank you for creating this issue. We will troubleshoot it as soon as we can.


    Info for maintainers

    Triage this issue by using labels.

    If information is missing, add a helpful comment and then I-issue-template label.

    If the issue is a question, add the I-question label.

    If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

    If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

    After troubleshooting the issue, please add the R-awaiting answer label.

    Thank you!

  2. RenderMichael commented on Nov 21, 2024

    @RenderMichael
    ContributorAuthor

    This is caused by a mismatch in parameter names between the interface ISupportsPrint.Print(options) and the implementing type WebDriver.Print(printOptions). This is considered incorrect (for reasons such as this one) but fixing it directly is a breaking change. We can do something like this:

    class WebDriver
    {
        void ISupportsPrint.Print(PrintOptions options)
        {
            if (options is null)
            {
                throw new ArgumentNullException(nameof(options));
            }
    
            Print(printOptions: options);
        }
    }

    This would throw an exception with the right parameter name, whether a user goes through the interface or the type. We can factor out the double null-check if that's desired.

    Edit: Default Interface Methods are not supported on .NET Standard 2.0, so this could only be applied to .NET 8.

  3. nvborisenko commented on Dec 1, 2024

    @nvborisenko
    Member

    Let's fix it, selenium doesn't follow SemVer. To negotiate this "minor" breaking change we will reflect this change in Blog post (automatically will be included).

    If we create a commit something like [dotnet] [breaking change] printOptions parameter name in Print method renamed to options, then it is enough. And, of course, reflect it in CHANGELOG when releasing.

  4. Delta456 commented on Dec 20, 2024

    @Delta456
    Member

    This PR can be closed as #14773 is merged which fixes it.

  5. github-actions commented on Jun 18, 2025

    @github-actions
    Contributor

    This issue is stale because it has been open 280 days with no activity. Remove stale label or comment or this will be closed in 14 days.

  6. added
    J-staleApplied to issues that become stale, and eventually closed.
    on Jun 18, 2025
  7. removed
    J-staleApplied to issues that become stale, and eventually closed.
    on Jun 19, 2025
  8. github-actions commented on Dec 16, 2025

    @github-actions
    Contributor

    This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 14 days.

  9. added
    J-staleApplied to issues that become stale, and eventually closed.
    on Dec 16, 2025
  10. removed
    J-staleApplied to issues that become stale, and eventually closed.
    on Dec 18, 2025
  11. github-actions commented on Jun 16, 2026

    @github-actions
    Contributor

    This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 14 days.

  12. added
    J-staleApplied to issues that become stale, and eventually closed.
    on Jun 16, 2026
  13. github-actions commented on Jul 1, 2026

    @github-actions
    Contributor

    This issue was closed because it has been stalled for 14 days with no activity.

  14. github-actions commented on Jul 31, 2026

    @github-actions
    Contributor

    This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

  15. locked and limited conversation to collaborators on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!I-defectSomething is not working as intendedJ-staleApplied to issues that become stale, and eventually closed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions