Dear Team!
I am trying to automate a UI menu navigation verification and I do have a nested dictionary in a .py
tabs= {
'key_1': {
'value_1',
'value_2',
'value_3'
},
'key_2': {
'value_1',
'value_2',
'value_3',
'value_4'
},
'key_3': {
'value_1',
'value_2'
}
I did create a keyword to load the keys into variables and similarly for values.
Keyword To Check Tab Visibility
FOR ${key} ${value} IN &{tabs}
${main_key} Set Variable ${key}
Log ${main_key}
FOR ${value} IN ${tabs}[${main_key}]
${subkey} Set Variable ${value}
Log ${subkey}
END
END
What I am trying to achieve here is to verify the main tab and subtab visibility in a menu navigation bar by looking up the locator by the text coming from the dictionary. The key would be the main menu element and the values are its subtabs.
However, as it is a multi value dictionary, when I iterate over the values based on their parent keys, it will load all the values to the same variable.
Like this:
${subkey}= {‘value_1’, ‘value_2’}
I would need to work with these values separately. Is there a way to split these values?
I am likely to over complicate this, if you could please bear with me, I would higly appreciate.
Thank you very much!