2

I need to pass a list from robot framework to python but I am unable to do that .

Kindly help in resolving the issue .

I have tried below mention robot code but it doesn't works :

${list1}= create list  a   b   c
${list2}= create list  d   e   f
cleanup1   ${list1}  ${list2}

python code :

def cleanup1(list1,list2):
    print (list1)
    print (list2)

Please help why is this failing ?

Expected output was to print both the list .

However I am getting error message :

No keyword with name ${list1}= create list found.

1
  • 1
    ${list1}= create list found you need to add at least one more space after the = sign. Same for the second list. Commented Jul 30, 2019 at 19:20

1 Answer 1

4

Robot uses two or more spaces to separate each component of a statement. You only have a single space between ${list1}= and create list. Robot, therefore, thinks that the first cell is ${list1}= create list. It expects to find either a variable or a keyword name in the first cell and it can't find a keyword named ${list1}= create list so it throws the error that you are reporting.

The solution is simple: make sure there are two or more spaces between the variable and the keyword:

${list1}=  create list  a  b  c
         ^^
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.