Is it possible to initialize a variable in a suite or test setup based on the return value of a keyword? I\'ve tried this sort of syntax and it didn\'t work:
Strictly speaking, no, it's not possible. Within a suite or test setup you can only call keywords, you cannot set variables to the result of other keywords directly within the setup statement .
That being said, it's easy to create a custom setup keyword that does what you want. For example:
*** Settings ***
| Suite Setup | Custom suite setup
*** Keywords ***
| Custom suite setup
| | ${A Variable}= | Set Variable | A String
| | Set suite variable | ${A Variable}
The above has the same effect as if robot supported setting variable from keywords directly in the setup. And, of course, you can call any keyword, not just Set Variable
.