2

I've tried to make some keywords in Robot Framework which has arguments embedded in the keyword name, according to (Robot Docs), but unfortunately I'm always getting None when I'm checking what is under the variable. Did you meet such behaviour? What have I done wrong??

My keyword example:

Set ${object} state to ${state}
    Log To Console  ${object}
    Log To Console  ${state}

Let's assume that ${object} and ${state} are strings, so the call of this keyword looks like this:

${status}=  Run Keyword And Return Status  Set camera state to locked
1
  • 1
    Your code looks good and I cannot reproduce your problem. I got True to ${status}. log.html should show you if your keyword does not return proper status. Can you modify your code to include both full testcase and full keyword. Commented Jun 17, 2015 at 9:52

1 Answer 1

3

Your code is fine. Here is a complete working example:

*** Keywords ***
Set ${object} state to ${state}
    Log To Console    ${object}
    Log To Console    ${state}

*** Test Cases ***
Example test case
    ${status}=        Run Keyword And Return Status    Set camera state to locked
    Should be True    ${status}
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.