How to print Testcase name for Failed TestSteps
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2019
05:36 AM
02-15-2019
05:36 AM
How to print Testcase name for Failed TestSteps
How to print Testcase name for Failed TestSteps on Logs when running testsuite through Commandline
when multiple test steps failed its very hard to find which testcases are failing when i am running testsuite through commandline
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2019
07:46 AM
02-16-2019
07:46 AM
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" ;
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2019
05:37 PM
02-17-2019
05:37 PM
@678,
Can you please check this thread:
https://stackoverflow.com/questions/41700437/creating-a-test-report-from-project-level-tear-down-scr...
Regards,
Rao.
Can you please check this thread:
https://stackoverflow.com/questions/41700437/creating-a-test-report-from-project-level-tear-down-scr...
Regards,
Rao.
