Passing *args in Robot Framework

Viewed 942

I know how to pass arguments to Robot Framework keyword but when are NOT sure about of arguments, is there any way to do it in the Robot Framework.

In python, we can use *args to pass multiple arguments when we are not sure. I am looking for some similar to that in Robot Framework.

1 Answers

You have to use the List variable syntax when defining the arguments in your keyword.

Here is an example:

*** Test Cases ***
Test
    Take Args    arg1    arg2    arg3

*** Keywords ***
Take Args
    [Arguments]    @{args}
    Log    ${args}           # Log as list
    Log Many    @{args}      # Log each item separately
Related