qentinelqi / qweb

Keyword driven automation for the web
https://github.com/qentinelqi/qweb
Apache License 2.0
39 stars 17 forks source link

Fix unbound local error with text anchors #111

Closed turunenm closed 1 year ago

turunenm commented 1 year ago

If config MultipleAnchors==True and no anchors are found in method QWeb/internal/text.py - get_element_using_anchor() then an UnboundLocalError raises due to missing handling for the condition.

Fixed by adding a check which now raises more appropriate exception QWebElementNotFound if no anchors are found.

Also includes a minor linting fix to QWeb/internal/decorators.py - perform()