Skip to content

Dropdown select fails with values with Unicode characters  #570

Open
@ctasca

Description

When trying to select a Dropdown option value that contains Unicode characters, it fails finding the option and perform the click.

# purchase_point is an instance inheriting from Dropdown
# class SelectFilter(Dropdown):
purchase_point = filters.get_filter(filters.PURCHASE_POINT)
purchase_point.select('Default Store View')

Screenshot_2024-03-04_at_16_07_22

Solution is to strip the option.html string in the _select function:

    def _select(self, value: str) -> List[str]:
        found_options = []

        for option in self.options:
            found_options.append(option.html.strip())
            if option.html.strip() == value:
                option.click()
                return []

        return found_options

After doing this my Scenario passed:
Screenshot 2024-03-04 at 16 19 34

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Dropdown select fails with values with Unicode characters · Issue #570 · jsfehler/stere