Cheers,
Martin
> --
> You received this message because you are subscribed to the
> Google Groups "robotframework-users" group.
> To post to this group, send email to
> robotframe...@googlegroups.com.
> To unsubscribe from this group, send email to
> robotframework-u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/robotframework-users?hl=en.
>
>
You probably need to do something like this (untested):
${status} ${message} = Run Keyword And Ignore Error Variable
Should Exist ${RESOURCES}
Run Keyword If "${status}" == "FAIL" Set Global Variable
${RESOURCES} ../../src/main/robot/resource
If you need to do that multiple times, creating a new user keyword is
probably a good idea:
Set Variable If It Does Not Exist [Arguments] ${name} ${value}
${status} ${message} = Run Keyword And Ignore Error
Variable Should Exist ${name}
Run Keyword If "${status}" == "FAIL" Set Global Variable
${name} ${value}
Using `Run Keyword And Ignore Error` like this is slightly confusing,
especially when the expression for `Run Keyword If` then need to
compare the status as a string. Should we add `Run Keyword And Return
Status` keyword that would execute the specified keyword and return
True or False depending on did the keyword pass or not? That would
make the above example somewhat more clear:
Set Variable If It Does Not Exist [Arguments] ${name} ${value}
${exists} = Run Keyword And Return Status Variable Should
Exist ${name}
Run Keyword Unless ${exists} Set Global Variable ${name} ${value}
Cheers,
.peke