How can I ignore specific keys in a dictionary using robot framework script? The dictionary is a nested dictionary.I tried with the below code but it removes the keys at the first level only. Any help is appreciated.
*** Variables ***
&{type} mobile=android mobileV2=windows
&{DICTIONARY} interface=ethernet interfaceId=default favorite=false mobile=android mobileV2=windows type=&{type}
*** Test Cases ***
Filter Dictionary Values
Log \nDictionaty values... : ${DICTIONARY} console=${True}
${d1_filtered} = Evaluate {k:v for k,v in ${DICTIONARY}.items() if k not in ('mobile','mobileV2')}
Log \nDictionaty filtered values... : ${d1_filtered} console=${True}
The resulting output log is given below.
Dictionaty filtered values... : {'interface': 'ethernet', 'interfaceId': 'default', 'favorite': 'false', 'type': {'mobile': 'android', 'mobileV2': 'windows'}}