How to Add Debug Data to the Result Browser

A helpful feature for reproducing testcase failures.

To aid in error analysis, XTC provides a feature that allows you to add your custom debug data to the result browser: the session’s value log is a storage for session-specific test parameters and result data. Any value you add to this log will later be available in the result browser.

Result browser containing custom debug data.

Note that the log will be cleared with each new iteration of the test scenario. The data may help to reproduce test failures by rerunning test scenario with the same data more easily, or simply present contextual data for recreation of error situations, either manually or automatically. This is especially useful if your test case uses random or randomly chosen test parameters.

You can add data to the value log at any point in your test scenario:

Session.getCurrent().getValueLog().put("data.I.want.to.keep", "This is essential data for reconstructing the test case I just ran."); 

Data is stored as name/value pairs. Even though the log accepts any Object as the value, the value will later be converted to a string using Object.toString() for proper display in the result browser. So make sure your value classes implement this method appropriately.

Last modified January 26, 2024