SeleniumLibrary icon indicating copy to clipboard operation
SeleniumLibrary copied to clipboard

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

Open Snooz82 opened this issue 1 year ago • 4 comments

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.

Snooz82 avatar Jan 17 '24 18:01 Snooz82

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

emanlove avatar Jan 20 '24 20:01 emanlove

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

Snooz82 avatar Jan 21 '24 07:01 Snooz82

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

emanlove avatar Jan 21 '24 15:01 emanlove