exit code for testrunner.bat in partial success of test cases
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2017
12:03 AM
11-06-2017
12:03 AM
exit code for testrunner.bat in partial success of test cases
If we want to run the test cases results as partially succeeded for the test cases where test execution completes with some pass and fail percentage.
For example-
Total test cases- 10
Total pass- 5
Total Fail- 5
So the percentage will be 50% pass, hence in this scenario I want to return the exit code as not failed but partially succeeded.
Is this possible?
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2017
03:57 AM
11-06-2017
03:57 AM
Hi Namrata,
Thank you for your post. The TestCase status can be Passed, Failed, Unknown and Cancelled. If you want to show another status, you can use the Groovy Test step and write a specific message to the log using this command:
log.info("Your message")
For example, add this script to the TestSuite TearDown script:
def count = 0 def countFailed = 0 for ( testCaseResult in runner.results ) { testCaseName = testCaseResult.getTestCase().name count = count + 1 if( testCaseResult.getStatus().toString() == 'FAILED' ) { countFailed = countFailed +1 log.info "$testCaseName has failed" } } def percentage = ( countFailed / count ) * 100 log.info("Percentage = " + percentage) if(percentage > 50) { log.info("Partially Succeed.") }
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
