How to get ${KEYWORD STATUS} in robot framework

Hi All,

I gone through robot guide. Found here-Robot Framework User Guide

I have written below keyword and teardown-
With Teardown
Log To Console Logging message
[Teardown] Log ${KEYWORD STATUS}

I want to get status every keyword at the end of keyword step execution.
I tried to directly log this inside my keyword but getting error like-
Variable ‘${KEYWORD STATUS}’ not found.

E.g. I have below keyword
Create User
complete user creation
IF “${KEYWORD_STATUS}” == “FAIL”
Log ${error_text}
Call API

Above teardown I have to call it in every step . Is there way I can directly check If ${KEYWORD STATUS}==‘FAIL’ then call some api .

Does robot automatically calls above teardown after every keyword execution. Currently I have to explicitly make call to it

Hi @bk-user,

Perhaps what you want is Run Keyword And Return Status

${status}=	Run Keyword And Return Status	complete user creation
IF “${status}” == “FAIL”
	Log ${error_text}
	Call API

Dave.

Thanks , Working @damies13.