Snooz82/robotframework-datadriver

Variable '${TEST STATUS}' not found

Closed this issue · 3 comments

Robot framework has TEST STATUS variable which is set to current status of test case. This variable is available in non template test cases (without using data driver) but when tests are run using data driver, this variable is not available.

*** Settings ***
Library           DataDriver    1.csv    optimize_pabot=Atomic
Test Template     Data Driver Test

*** Keywords ***
Data Driver Test
    [Arguments]    ${var}
    ....
    [Teardown]    Log to console    ${TEST STATUS}

robot  --variable DYNAMICTEST:'xxx'  test.robot

Variable '${TEST STATUS}' not found. Did you mean:
    ${PREV_TEST_STATUS}

I assume, that this is because a templated test does contain just one keyword.
That is the keywords [Teardown] and not the one from test.

try to use Test Teardown.
i will test this as well.

You are right that with common "Test Teardown" I don't get that error. But I need to do cleanup in Teardown which refers to resources generated inside the template keyword.

One way would be to export each of those variables (Set Test Variable). Any better solution ?

Nope.

no better idea.
You could put it into a dictionary and set that to test scope.