Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name locator for elements with spaces in the name #339

Open
blutorange opened this issue Feb 13, 2023 · 1 comment
Open

Name locator for elements with spaces in the name #339

blutorange opened this issue Feb 13, 2023 · 1 comment
Assignees

Comments

@blutorange
Copy link
Contributor

Today I was creating a Selenium IDE test for a page that had an element with a name attribute containing a space, e.g. name=btnDisable Validation. With the Firefox browser addon, the locator name=btnDisable Validation worked and the element was found. When I tried running the test via selenese-runner-java, it failed with the error message that it could not locate the element.

Taking a look at the source, this appears to be a feature? selenese-runner-java splits the argument on on the first space, and uses the second part as an index filter or regexp filter on the value:

https://github.com/vmi/selenese-runner-java/blob/master/src/main/java/jp/vmi/selenium/selenese/locator/NameHandler.java#L30-L31

Now I was wondering -- is this standard Selenium IDE behavior or is this specific to selenese-runner-java? The documentation pages from Selenium IDE unfortunately don't mention the selector syntax (or I didn't find it). Or was this perhaps once a feature of Selenium IDE and since removed? Or is it perhaps just the browser addon that's not behaving as it should?

I can work around this for now but it would be great if selenese-runner-java could be as close as possible to Selenium IDE

@blutorange
Copy link
Contributor Author

At least in the current Selenium IDE repo there does not seem to be any logic that splits locators on space and looks for index=... or value=...

https://github.com/SeleniumHQ/selenium-ide/blob/53dc09104c2ec801ecd78d1878b3fd9eb036e892/packages/side-runtime/src/webdriver.ts#L1785-L1797

@vmi vmi self-assigned this Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants