user10028942
user10028942

Reputation:

Oneliner to initiate list of lists in Robot Framework?

What is the shortest way to initiate nested lists with some values in Robot Framework?

Something like:

myList = new List (new List (1, 2 , 3), new List (a, b, c))

Upvotes: 1

Views: 1743

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 386220

You can use the Evaluate keyword. You can then use normal python syntax to define the list.

*** Test Cases ***   
Example
    ${myList}=  Evaluate  [[1,2,3], ['a', 'b', 'c']]

    should be equal  ${myList[1][2]}  c

Upvotes: 3

Related Questions