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

Cannot use default strategy when a '=' is in the locator #193

Closed
ombre42 opened this issue Apr 12, 2013 · 0 comments · Fixed by #335
Closed

Cannot use default strategy when a '=' is in the locator #193

ombre42 opened this issue Apr 12, 2013 · 0 comments · Fixed by #335

Comments

@ombre42
Copy link
Contributor

ombre42 commented Apr 12, 2013

The following code will fail because ElementFinder assumes '=' separates a prefix from the value and interprets 'detail?name' as a locator prefix:

Open Browser    https://code.google.com/p/robotframework/downloads/list?can=1&q=
Page Should Contain Element    xpath=//a[@href='detail?name=robotframework-2.7.7.win32.exe&can=1&q=']
Click Link    detail?name=robotframework-2.7.7.win32.exe&can=1&q=

actual error:
ValueError: Element locator with prefix 'detail?name' is not supported

This forces the user to use a specific strategy. If a prefix 'default' were added, then the user could do this as a workaround:

Click Link    default=detail?name=robotframework-2.7.7.win32.exe&can=1&q=

Other options include:

  • provide to provide a way to escape '='s.
  • use the default strategy when a locator prefix is not recognized rather than raising an error
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 a pull request may close this issue.

1 participant