Test data as array, list or tuple

Hi,

Is to possible manage a test data with other data than single data ? For example, I talk about list for the second argument :

*** Keywords ***
Get list from second argument
[Arguments] {first_arg} @{second_arg} {third_arg}

If it is possible, how to set the CSV test data to five a explicit list to @{second_arg} ?

Thanks a lot for any ideas or opinions.

yes that is possible:

DataDriver does support Scalar, Dictionaries, Lists and Python literals.

But be aware that these data must be given as single argument to robot.

*** Test Cases *** ${scalar} @{list} &{dict} e{dict_eval}
One value 1,2,3,4 key=value ['a','b','c']
Two hello 3,2,1,0 key=some ['d','e','f']
keyword
    [Arguments]    ${scalar}    ${list}    ${dict}    ${python_eval}
    Log     ${scalar}
    FOR    ${elem}    IN    @{list}
        Log    ${elem}
    END
    Log    ${dict}[key]
    Log    ${python_eval}[1]
1 Like

It works perfectly !

Thank you René for the example about each kind of parameters.

@René , can we supply a list of list in data driver. For example,

@{numbers}    1    2    3
@{letters}    a    b    c    d
@{listoflists}    ${numbers}    ${letters}