0

I need to pass default mutable arguments in robot framework.In python generally we will initialize the argument to None to achieve the task but i am not sure how to pass the same functionality in robot framework.PFB the scenario:

Number of users involved
[Arguments]  ${user1}  ${user2} ..... .... ....  .....  ..... ${userN}

In above scenario i need to give default mutable arguments say it till N.The scenario requires that i will define all the arguments in 1st step so that i will not change every time whenever i am using keyword for 2 users, 3 users, 4 users or N users in the respective test case.

PF how we will call that keyword:

 Number of users involved  ABC XYZ  --> 1st scenario
 Number of users involved  ABC XYZ GFH ABC ......  --> 2nd scenario

My questions are as below: 1) How to pass default mutable arguments in robot framework if its possible?

3
  • 1
    What have you tried already and why doesn't it meet your expectations? Commented Mar 4, 2019 at 8:50
  • Why do you need to give them all default values? Why not just accept a variable number of arguments? Commented Mar 4, 2019 at 14:25
  • Thanks -> @BryanOakley Commented Mar 5, 2019 at 7:41

1 Answer 1

6

You could try to use variable number of arguments http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#variable-number-of-arguments

Number of users involved
    [Arguments]    @{users}
    :FOR    ${user}    IN    @{users}
    \    Log    ${user}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.