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

Wrong Type Hint on some keywords. (locator: Union[WebElement, None, str]) #1880

Closed
Snooz82 opened this issue Jan 17, 2024 · 4 comments · Fixed by #1898
Closed

Wrong Type Hint on some keywords. (locator: Union[WebElement, None, str]) #1880

Snooz82 opened this issue Jan 17, 2024 · 4 comments · Fixed by #1898
Assignees
Labels
acknowledge To be acknowledged in release notes bug in progress priority: high
Milestone

Comments

@Snooz82
Copy link
Member

Snooz82 commented Jan 17, 2024

Some keywords like Capture Element Screenshot do have a type hint, that allows WebElement, None and str.
But the None is actually wrong.
There are some keywords that actually would work with ${None} as a locator, but this one and others actually does not work and raises the error TypeError: expected string or bytes-like object, got 'NoneType'

Fix would be to just remove the None.

@emanlove
Copy link
Member

René do you have a list of keywords you discovered that this affects?

@Snooz82
Copy link
Member Author

Snooz82 commented Jan 21, 2024

Not at directly.
I remembered that it was more than one.
search for those which has None as type hint, but no default.

@emanlove
Copy link
Member

Danke schön René. I'll take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledge To be acknowledged in release notes bug in progress priority: high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants