SeleniumHQ / SeleniumHQ/selenium
[🚀 Feature]: [dotnet] [bidi] Polymorphic static factory
- Dominant language
- Java
- Stars
- 34.5k
- Forks
- 8.7k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 92
Description
### Description
Currently:
```csharp
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.
```csharp
await _context.LocateNodesAsync(Locator.InnerText("Sign In"));
```
Very simple and useful. What about optional parameters? It will be implicitly available via:
```csharp
await _context.LocateNodesAsync(Locator.InnerText("Sign In") with { IgnoreCase = true });
```
Contributor guide
Assessment
This issue has not been assessed yet.