Contributions
Re: Groovy Rerun Failed Test Case Execution Report
I have added assertion as a Test step in the test case. Since, the assertion can pass only if the value in response matches the assertion value, the test case may fail on multiple retries but it will keep on re running for a fixed number of times. The point here is not the execution but the reporting, after multiple retries if the Test Cases is passed it is marked as Pass at Test Suit level on the tool interface but in the Test Suit Printable Report is still shows fail. Is there a way to pick the final status and not the first instance in report. PS : I found a way to keep the results in csv file , it shows all the retries with execution status.4 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.4KViews0likes1CommentRe: Groovy Rerun Failed Test Case Execution Report
Actually, the problem statement for me is that the api would return different response for consecutive requests and I need to validate a specific value whose order is random. So I am running it for maximum 40 times in case of failure. Is there any way to create a customized report using groovy which can keep the latest pass fail results.4 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.4KViews0likes3CommentsRe: Groovy Rerun Failed Test Case Execution Report
nmrao sorry for the confusion. Here's the teardown script at project level I am using: def testSuiteResults = context.getTestRunner().getResults() def testCaseResults def runCount =0 def testPassed = true // Iterate through each test case in the project testSuiteResults.each { it.getResults().each { // PASSED test case if ( it.getStatus().toString().equals("PASS") ) { log.info "The test case '" + it.getTestCase().getName() + "' has passed!" // FAILED test case } else { testPassed = false log.info "The test case '" + it.getTestCase().getName() + "' has failed!" runCount =0 // Rerunning the failed test case... while ((runCount < 40) && (testPassed == false)) { log.info "Rerunning the test for the " +runCount +"time" if (it.getTestCase().run(new com.eviware.soapui.support.types.StringToObjectMap(), false).getStatus().toString().equals("PASS")) { testPassed = true log.info "The test case "+ it.getTestCase().getName() + " case has eventually passed!" } else { log.info "The test case "+ it.getTestCase().getName() + " did not pass" } runCount++ } } } } Using this script I am able the re-run failed test cases for maximum 40 times and test case may pass eventually. The issue is Junit-style report generated from tool still shows them as failed even if they pass after several retries. Is there a way to keep the final result in the report?4 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes6CommentsGroovy Rerun Failed Test Case Execution Report
I am using groovy script to rerun failed test cases but in Junit-Style Report , the test cases are still coming as failed even though they got passed after several retries. Could you please let me know how to ensure that only the final execution test status is available in the report. Please find the link for groovy script used for rerunning failed test cases :https://community.smartbear.com/t5/API-Functional-Security-Testing/Groovy-script-to-re-run-failed-tests/td-p/168404Solved2.5KViews0likes9Comments