I think you cannot declare a variable inside a loop in RF.
In RF you should use Collections library
First you “create list” then inside of a loop you will “append to list”
But I am not sure what are you trying to accomplish with that test Please provide a little context so I can be more specific.
And CSS selectors enable a bit clearer selector :).
${parents} = Get Elements g.highcharts-legend-item