In the Robot Framework, what is the difference between a List variable and a Scalar Variable containing a list?

In the Robot Framework, we can assign a Scalar Variable or a List Variable, as shown below:

| @{list} = | Create List | a | b | c | | ${scalar} = | Create List | a | b | c | 

What is the difference between a List variable and a Scalar Variable containing a list?

+5
source share
1 answer

In the case of the assignment indicated in your question, there is no difference. If you register each of them, you will get the exact result.

Note : this functionality was introduced in version 2.8 (see Using Scalar Variables as Lists in the User Robot Framework Guide).

The difference arises when you use values. When you use the @ symbol to refer to a list, each of the elements in the list becomes a cell. In the following example, the following three lines give the same results:

 | | A keyword that expects three arguments | a | b | c | | A keyword that expects three arguments | @{list} | | A keyword that expects three arguments | @{scalar} 
+6
source

Source: https://habr.com/ru/post/1201552/


All Articles