Solved
Forum Discussion
TanyaYatskovska
Alumni
9 years agoGreat to hear your solution. Thanks for sharing it!
While deep learning Java I found another solution, but it risky because you can modify testStepResult as much as you can and possibly lost test consistency. Solution is Java Reflection API in general, but I use version from apache commons library:
In Events window:
import static org.apache.commons.lang3.reflect.FieldUtils.writeDeclaredField; writeDeclaredField(testStepResult, "messages", ["Hiiiiiiiiiiiii!"], true); log.info testStepResult.getMessages()[0]
Code modify private field "messages" with List<String> type in testStepResult object.
Output:
<...> :INFO:Hiiiiiiiiiiiii!