i am using robot framework version=7.4
i want to access the values in a nested dictionary,
for example it is:
ret = [0, {‘2’: {‘data’: [1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18], ‘min’: 1.18, ‘max’: 1.18}, ‘3’: {‘data’: [1.19, 1.19, 1.19, 1.19, 1.19, 1.19, 1.19, 1.19, 1.19, 1.19, 1.19], ‘min’: 1.19, ‘max’: 1.19}, ‘0’: {‘data’: [1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18], ‘min’: 1.18, ‘max’: 1.18}}]
—————————————————————————————————————
i am using variable.yaml that is imported in ***setting*** :
Variables variable.yaml
the yaml is:
SPK:
RR_P:
FI: 0
AI: 0
FR_P:
FI: 2
AI: 2
FL_P:
FI: 1
AI: 1
RL_P:
FI: 3
AI: 3
the below code fails:
Log To Console ${ret[1]}[${SPK.FR_P.AI}]
error: Dictionary ‘${ret[1]}’ has no key ‘2’
the below code also fails:
Log To Console ${ret[1]}['${SPK.FR_P.AI}']
Dictionary ‘${ret[1]}’ has no key ‘‘2’’
but the below code pass:
${a} Convert To String ${SPK.FR_P.AI}
Log To Console ${ret[1]}[${a}]
{‘data’: [1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18], ‘min’: 1.18, ‘max’: 1.18}
but the below code pass:
Log To Console ${ret[1]}[2]
{‘data’: [1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18, 1.18], ‘min’: 1.18, ‘max’: 1.18}
- what is difference? What is the type of variable from YAML in robot view?