SeleniumHQ / SeleniumHQ/selenium

[🐛 Bug]: Cookies management is not consistent

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

Description

### What happened?

In C#:
```csharp
driver.FindElement(By.CssSelector("abc")); // throws NoSuchElement
```

```csharp
driver.Manage().Cookies.GetCookieNamed("abc"); // null if not found
```

But according spec it should throw an exception: https://www.w3.org/TR/webdriver2/#get-named-cookie

### How can we reproduce the issue?

```shell
It is about API consistency
```

### Relevant log output

```shell
No output
```

### Operating System

any

### Selenium version

any

### What are the browser(s) and version(s) where you see this issue?

any

### What are the browser driver(s) and version(s) where you see this issue?

any

### Are you using Selenium Grid?

_No response_

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.