Skip to content

#164 Include locator in NoSuchElementException - #165

Open
liefke wants to merge 2 commits into
SeleniumHQ:masterfrom
liefke:#164-include-locator-in-error-message
Open

liefke wants to merge 2 commits into
SeleniumHQ:masterfrom
liefke:#164-include-locator-in-error-message

Conversation

@liefke

@liefke liefke commented Sep 24, 2026

Copy link
Copy Markdown

This is a proposal for changing the error messages of HtmlUnitDriver.findElement(By.cssSelector(...)), as described in #164.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@CLAassistant

CLAassistant commented Sep 24, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.


if (value.indexOf(' ') != -1) {
throw new InvalidSelectorException("Compound class names not permitted; contains blank");
throw new InvalidSelectorException("Compound class names not permitted; contains blank: " + value);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets enclose the value in single quotes to make also trailing, leading blanks visible. Same for the others

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the problem right here and added the quotes to this message, but for CSS selectors this is not really necessary, because leading and trailing spaces are ignored anyway.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants