Skip to content

[🐛 Bug]: InvalidSelectorException is not a NoSuchElementException #10833

@joerg1985

Description

@joerg1985

What happened?

The InvalidSelectorException in Java derives from NoSuchElementException, a FluentWait will retry until the timeout is reached.
The InvalidSelectorException in C# derives from NoSuchElementException, a WebDriverWait will retry until the timeout is reached.
The InvalidSelectorException in Python derives from WebDriverException, a wait will instantly fail.

This is confusing in my mind, is it correct to derive InvalidSelectorException from NoSuchElementException?
Will a invalid selector, repair it self over time?

How can we reproduce the issue?

search By.xpath("]") using a FluentWait / WebDriverWait / wait

Relevant log output

N/A

Operating System

Windows 10 x64

Selenium version

4.x.x

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

N/A

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

N/A

Are you using Selenium Grid?

No response

Metadata

Metadata

Assignees

Labels

C-dotnet.NET BindingsI-defectSomething is not working as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions