I use latest Robot Framework. I need to assign a value to my variable depending on value of an argument. That's how it would be in JavaScript:
ITEM_SELECTOR = RECENT_ITEM_SELECTOR + (
position === 'last' ? ':last-child' : ':nth-child' + '(' + position + ')'
)
This is how I try to write it in Robot Framework:
${ITEM_SELECTOR} = Run Keyword If ${position} == 'last' ${RECENT_ITEM_SELECTOR}:last-child
... ELSE ${RECENT_ITEM_SELECTOR}:nth-child(${position})
but this way ${RECENT_ITEM_SELECTOR}:nth-child(${position}) is considered a keyword, not assigned to ITEM_SELECTOR.
Then I try to preprend it with No Operation, but then my return value is considered its argument and I get Keyword 'BuiltIn.No Operation' expected 0 arguments, got 1.
How can I write it?