SeleniumHQ / SeleniumHQ/selenium

[🚀 Feature]: implement namespacing methods as properties

Open
#14,065 30 comments 2 reactions 0 assignees View on GitHub
A-needs decision C-dotnet I-enhancement
Dominant language
Java
Stars
34.5k
Forks
8.7k
Avg merge
2d 1h
Merged PRs (30d)
92

Description

### Feature and motivation

.NET copied the Java approach of using methods for namespacing:
```
driver.Manage().Cookies().AddCookie(cookie)
```

When a more idiomatic way would be to use properties.
This came up when discussing adding the BiDi functionality. Rather than mixing them, or using the old way, I propose we add the properties and deprecate the methods.

### Usage example

```
driver.Manage.Cookies.AddCookie(cookie)
```

### Community Proposal

#### Cookies

`driver.Cookies`

```csharp
IReadOnlyList GetAll();
Cookie? Get(string name);
void Add(Cookie cookie);
void Delete(Cookie cookie);
void Delete(string name);
void DeleteAll();
```

#### Logs

`driver.Logs`

```csharp
IReadOnlyList GetAvailableTypes();
IReadOnlyList GetAll(string type);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.