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

Unable to get an element via query on attribute(containing hyphens) value using an XPATH #1751

Closed
hasanmehmood opened this issue Mar 6, 2016 · 1 comment

Comments

@hasanmehmood
Copy link

Hello All,

Hope everybody is doing great. I'm facing very weird scenario in getting an element having an attribute using an XPATH. The problem is that if the attribute contains more than one Hyphens in it then Selenium is unable to find that element. I am using Python. And Selenium 2.52.0.

Example that works fine.

<span data-one="containingOnlyOneHyphen"> </span>
XPATH = '//*[@data-one="containingOnlyOneHyphen"]' (Works Completely Fine)

Example that doesn't work.

<span data-one-two="containingTwoHyphen"> </span>
XPATH = '//*[@data-one-two="containingTwoHyphen"]' (Does not work :/ )

So far my understanding with this issue is that Selenium is unable to find element based on attribute having more than 1 hyphens in it.

It would be great if you can guide me anything regarding this issue. I've almost tried everything but failed.

Thanks & kind Regards,

Hassan Mehmood

@barancev
Copy link
Member

barancev commented Mar 6, 2016

This is a question rather than an issue. Please send questions to the selenium user group

For issues please provide a concise reproducible test case and describe what results you are seeing and what results you expect.

See CONTRIBUTING.md

@barancev barancev closed this as completed Mar 6, 2016
@lock lock bot locked and limited conversation to collaborators Aug 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants