Skip to content

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

@ombre42

Description

@ombre42

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions