RPA.RobotLogListener
RobotLogListener is a library for controlling logging during a Robot Framework execution using the listener API.
About keyword parameters
Parameters names and keywords for keywords Mute Run On Failure and Register Protected Keywords do not need to be full names of keywords, ie. all keywords matching even partially will be affected. Run Keyword would match all BuiltIn library keywords (17 keywords in RF 3.2.1) and of course all Run Keyword named keywords in any resource and/or library file which are imported would be matched also.
Mute Run On Failure
This keyword is to be used specifically with RPA.Browser.Selenium library, which extends SeleniumLibrary. Normally most of the SeleniumLibrary keywords execute run_on_failure behaviour, which can be set at library initialization. By default this behaviour is running Capture Page Screenshot keyword on failure.
In the example task Check the official website below the keyword Run Keyword is muted and when it runs the keyword Element Should Be Visible then those failures do not create page screenshots into log file.
It is also possible to change default failure behaviour by giving parameter optional_keyword_to_run for Mute Run On Failure, see task Check the official website with error log. This optional keyword would be then executed on failure. Due to the underlying SeleniumLibrary implementation this keyword can't have arguments.
Example of using Mute Run On Failure without and with optional keyword to run.
Register Protected Keywords
This keyword is used to totally disable logging for named keywords. In the example below the keyword This will not output is protected and it will not be logging into Robot Framework log files.
Robot Framework
Python