Skip to content

[πŸš€ Feature]: [dotnet] [bidi] Polymorphic static factoryΒ #16156

@nvborisenko

Description

@nvborisenko

Description

Currently:

await _context.LocateNodesAsync(new InnerTextLocator("Sign In"));

It is nice low-level implementation. Basically LocateNodesAsync method accepts abstract Locator. It means when user writes a code he doesn't know which well-known inherited classes from Locator he may use. This is common issue in .NET.

Have you considered any alternatives or workarounds?

How to resolve: introduce static factory.

await _context.LocateNodesAsync(Locator.InnerText("Sign In"));

Very simple and useful. What about optional parameters? It will be implicitly available via:

await _context.LocateNodesAsync(Locator.InnerText("Sign In") with { IgnoreCase = true });

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs decisionTLC needs to discuss and agreeB-devtoolsIncludes everything BiDi or Chrome DevTools relatedC-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