Adding test results directly suite_results.create doesn't work

It’s hard to read your examples because they aren’t formatted correctly. Anyway, it seems that you have already found the reason why changes to, for example, test case name aren’t possible in the end_test listener method. The test name has been already written to output.xml earlier and thus the change change has no effect. Also if you create new tests results with tests.create(), they are only created in memory and Robot doesn’t know they should be written to output.xml.

I didn’t fully understand what you are trying to do, but here are some alternatives that may help:

  • If you want to create new tests dynamically during execution, you need to do them in start_suite or end_test so that you modify data, not result. These newly added tests will be executed and logged as expected. You can then modify them further when they are executed.
  • An alternative solution would be modifying results after execution. This can accomplished with the --pre-rebot-modifier option or by parsing results, modifying them and saving the modified results. How to use the former is explained in the User Guide and the result APIs are documented in the API docs.