-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Open
Labels
A-needs-triagingA Selenium member will evaluate this soon!A Selenium member will evaluate this soon!C-dotnet.NET Bindings.NET BindingsI-enhancementSomething could be betterSomething could be better
Description
Description
Currently:
var options = new ChromeOptions();
options.AddArgument("--a");
options.UseWebSocketUrl = true;
var chrome = new ChromeDriver(options);Have you considered any alternatives or workarounds?
var chrome = new ChromeDriver(hd =>
{
hd.AddArguments("--a").UseWebSockeUrl();
});Why:
Currently there are so many constructor overloads. And even all of them don't cover everything what it can opt-in. To specify commandTimeout I should use some constructor where commandTimeout is last argument. If we will support one more argument, then we should duplicate all constructors.
Conceptually, any WebDriver is:
- DriverService (chromedriver.exe)
- Browser options (Capabilities?)
- HTTP client (transport)
WebDriverBuilder will be single entry point, allowing:
- Fluently describe what driver to start
- Configure driver service (even to be reusable if user wants)
- Configure HTTP low-level client
Pseudo example:
var chrome = new ChromeDriver(hd =>
{
hd.WithVersion("145.1").
.WithService(s => s.UseFeatureA().UseFeatureB()) // or .WithService(_myExistingService)
.WithHttp(h => { h.DefaultHeaders.Add("x-name", "john"); h.UseProxy = false } );
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-needs-triagingA Selenium member will evaluate this soon!A Selenium member will evaluate this soon!C-dotnet.NET Bindings.NET BindingsI-enhancementSomething could be betterSomething could be better