0

I found a way to create dynamic test cases in Robot framework using below post, and its working good.

Robot framework: Is there a way to write dynamic test cases?

However, the problem I am facing is with assigning the return value of the keyword to a variable. I could not find the syntax for it using dynamic format. I tried some options, but none of them worked.

For example, if I want to write in Robot Framework:

${Results}= | SSHLibrary.Execute Command | pwd
Log | ${Results}

Attempt 1: I wrote in the dynamic syntax as:

test.keywords.create('${Results}=       Execute Command', args=['pwd'])
test.keywords.create('Log', args=['${Results}'])

This gives me error:

No keyword with name '${Results}=       Execute Command' found.

Attempt 2: Then I tried:

Results = test.keywords.create('Execute Command', args=['pwd'])
test.keywords.create('Log', args=[Results])

It just prints the command, not the output.

Log snapshot

Pls advise! Thanks in advance.

2

0

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.