1

I want to create a custom settings (OR Attribute) (say TEST_ID) in Robot Framework to tag them with test id. During teardown I will use that settings to update my test management tool to record the execution result.

*** Test Cases ***
Test With Settings
    [Documentation]    Another dummy test
    [Tags]    dummy    owner-johndoe
    [TEST_ID] XXX
    Log    Hello, world!

1 Answer 1

1

There is no need to create a new attribute. You can use tags. You could tag your tests with something like ALMID:5432. In the teardown, the tags are available via the builtin variable @{TEST_TAGS}. The list could be searched and the id extracted from the tag.

Sign up to request clarification or add additional context in comments.

4 Comments

Though not exactly what I was looking for but this can get me going
Downside to this is the statistics get mucked up. This can be fixed with extra parameters to robot.run: --tagstatexclude ALMID:*
it looks like @{TEST_TAGS} is not available in teardown. Suite teardown failed: Several failures occurred: 1) Variable '@{TEST_TAGS}' not found. I have tried @{TEST TAGS} as well
It would not make sense for @{TEST_TAGS} to be defined in the suite teardown. Which test would the tags belong to? If you want to only update your test management database after the suite is over, you can store results of each test in memory. I would consider implementing your solution in a listener.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.