Forum Discussion
CharlesHarold
6 years agoOccasional Contributor
Using a groovy assert statement, anything after the colon is printed when the assertion fails.
So, in a Groovy Step (where "testRunner" is available:
String expected = "Bob" ;
String actual = "Alan" ;
assert actual == expected : testRunner.testCase.name + ": Actual does not match Expected" ;
And in a Script Assertions in a an Assertion Step (where only "context" is available):
String expected = "Bob" ;
String actual = "Alan" ;
assert actual == expected : context.testCase.name + ": Actual does not match Expected" ;