Skip to content

Conversation

@sinpru
Copy link

@sinpru sinpru commented Nov 13, 2025

Fixes #138


private (string strategy, string value) ParseCssSelector(string cssSelector)
{
if (cssSelector.StartsWith("#"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not sufficient to judge that it is a simple CSS ID selector. To be sure, shouldn't a regex be used that checks that the complete cssSelector string matches a simple ID selector? It may be that the user sends a compound selector instead, and we should have a proper error message in that case that this is not supported.

The same comment holds for all parses below. To check that a regex matches the string fully, start with ^ and end with $.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed!

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.

Using Selenium.WebDriver's By.Id for finding elements fails when the ID starts with a numeral

2 participants