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

Dropdown select fails with values with Unicode characters #570

Open
ctasca opened this issue Mar 4, 2024 · 0 comments
Open

Dropdown select fails with values with Unicode characters #570

ctasca opened this issue Mar 4, 2024 · 0 comments

Comments

@ctasca
Copy link

ctasca commented Mar 4, 2024

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

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

No branches or pull requests

1 participant