Snooz82/robotframework-datadriver

RF Variable Syntax not considered in columns for dictionary values

Closed this issue · 3 comments

In my CSV/XLS file I have a column with name ${data.value} and the value for the testcases should always be an integer.
I tried to put in the number without RF Syntax (e.g. 12) and with RF syntax for int (e.g. ${12}).
In both cases the value is handled as string, this is the case for CSV and Excel files as well.
Log ${data} => {'value': '12}
Log ${data} => {'value': '${12}'}

I would expect in the second case: {'value': 12}

Hi Franky,

This is a bug.
When using dictionary notation the variables are not resolved.

you can however workaround it with using the python evaluation prefix.

e{data.value} with the cell value 12 will resolve into Log ${data} => {'value': 12}

Sorry, I dont understand...
Using either e{{data.value}} or e{data.value} (syntax from the example) for column name creates an error:
Calling method '_start_suite' of listener 'DataDriver' failed: SyntaxError: invalid syntax (, line 1)

Oh yes that was a bug too... 😂
The literal Eval i used was not able to evaluate a number itself...
Fixed that as well.

New Version 1.3.0 will fix both.