Hi all,
I am trying to add “test results” to robotframework dynamically, and have some problems occurred.
The below is a simplified test of what I am trying to do, the below is a test (to test if adding “test results” directly) will show up in the final output.xml
I created a listener v3, and imported it as a library.
I registered a
start_suite listener, to keep record of the current suite
_start_suite(self, stuite, result):
self.currentSuite = suite
end test listener
def _end_test(self, test, result):
# test for creating a test result directly (from a existing test)
test_result = self.currentSuiteResult.tests.create(test.name+‘APPENDED_TEST’,
test.doc,
test.tags,
None,
test.lineno,
test.start_time)
# apply all settings from test to test_result
test_result = test
# modify the name
test_result.name = test.name+'MODIFIED"
I tried copying the result testcase, with a different name, and adding it to the suite results as below
test_result = self.currentSuiteResult.tests.create(test.name+'MODIFIED',
test.doc,
test.tags,
None,
test.lineno,
test.start_time)
test_result = test
test_result.name = test.name+'MODIFIED"
But it doesn’t seem to show up in the final output.xml (or report.html)
Is there something else I need to do for it to work?
Thanks for the help!
Note:
on why I am trying to add test results without any test case: I used robotframework to execute a googletest executable, which results in a xml file. Since there are multiple test cases within the googletest, I would like to add them into the googletest results. I didn’t create a new “dynamic test case” since there isn’t a need to execute anything.