robocorp / rpaframework

Collection of open-source libraries and tools for Robotic Process Automation (RPA), designed to be used with both Robot Framework and Python
https://www.rpaframework.org/
Apache License 2.0
1.17k stars 225 forks source link

`RPA.Windows`: bubble up errors when `Select` is attempted on non-existent value #1150

Open kkotenko opened 9 months ago

kkotenko commented 9 months ago

Currently, when I accidentally try to Select a value in a ComboBoxControl, and the value is not present, I get no error whatsoever. So I am left with having to check beforehand if the options of the dropdown contain my target value.

In this case, uiautomation does produce a log entry in its own loggers

https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/abb247330bcba4fdb9244f669f451edcab5f4125/uiautomation/uiautomation.py#L7134

and returns False.

However, this message is not bubbled up to me as the user of RPA.Windows, and the return value is not processed: https://github.com/robocorp/rpaframework/blob/092591f72b2ff5d7628f573306899ae7ef6622c3/packages/windows/src/RPA/Windows/keywords/action.py#L234-L245

I would provide a PR, but I am not sure myself what the best solution would be.