Skip to content

[🚀 Feature]: [dotnet] Reevaluate Add* methods in DriverOptions #15700

Open
@nvborisenko

Description

@nvborisenko

Description

To initiate Options object we have to write:

var options = new ChromeOptions { UseWebSocketUrl = true };

options.AddArgument("remote-debugging-port=9222");

At the same time we still have an access to:

options.Arguments // ReadOnlyCollection

In general it looks like

Image

Have you considered any alternatives or workarounds?

What if we remove all Add* methods and allow collections to be natively mutable? It will significantly simplify usage:

var options = new ChromeOptions
{
  UseWebSocketUrl = true.
  Arguments = { "remote-debugging-port=9222" }
};

And finally even to be focused on driver initialization without any intermediate local variables:

var driver = new ChromeDriver(new ChromeOptions
{
  UseWebSocketUrl = true.
  Arguments = { "remote-debugging-port=9222" }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!C-dotnet.NET BindingsI-enhancementSomething could be better

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions