ContributionsMost RecentMost LikesSolutionsHow to get the execution iteration number along with their respective assertion failed messages Hi Team, How to get the execution iteration number along with their respective assertion failed messages in testcase teardown script when we have Datasource(Excel) and Datasource loops steps to test the same functionality with multiple test data. Below is the code which i am using in teardown script. with this i am able to get the total failed assertion messages, but the problem is not clear which iteration got failed and which got passed.(means if my test case run for 10 data rows based on the datasource loop step if one test case get failed i am geeting that failed messages but how can i know which iteration got failed among the 10) My question is how to get the failed assertion messages test case iteration wise not steps wise from test case terdown script. def step_a = ""; for (testStepResult in testRunner.getResults() ) { def testStep = testStepResult.getTestStep() step_a = step_a + "TestStep [ " + testStep.name + " ] finished with status " + testStepResult.getStatus().toString() + "\n" //log.info testStep.testRequest.response.responseHeaders if (testStep instanceof com.eviware.soapui.model.testsuite.Assertable) { for( assertion in testStep.assertionList ) { def messages = "" def isAssertionLogged = false for( message in testStepResult.getMessages() ) { if(message.contains(assertion.name)) { messages = messages + testStep.name + "- Error [" + message + "]" + "\n";; isAssertionLogged = true break } } if(isAssertionLogged) //if there is no error message for the assertion, the assertion is either passed (VALID) or was not ran (UNKNOWN) { step_a = step_a + "Assertion [" + assertion.label + "] has status [FAILED]" + "\n"; step_a = step_a + messages; } else { if(assertion.isDisabled()) { step_a = step_a + "Assertion [" + assertion.label + "] has status [UNKNOWN]" + "\n" } else { step_a = step_a + "Assertion [" + assertion.label + "] has status [OK]" + "\n" } } } } log.info( step_a) }//end for log.info "Let’s get Test run results" File file = new File("C:/Users/cn326923Results/TestRunnerStatus20.txt") file.write step_a Thanks in advance Re: How to get the execution iteration number along with their respective assertion failed messages My question is how to get the failed assertion messages test case iteration wise not steps wise from test case terdown script. Re: Groovy script to run the excel data source test step from groovy script Hi KarelHusa Now i am able to get all the failed assertion messages. But how can i know which iteration got failed and that respective failed assertion messages, which iteration got passed in teardown script itself.(I am using 2nd approach from your suggestions). Re: tear down script to get each iteration failed assertion messages at testcase level Thanks KarelHusa for the prompt response tear down script to get each iteration failed assertion messages at testcase level Hi Team, In my test cases i have Datasource(Excel) and Datasource loops steps to test the same functionality with multiple test data. Below is the teardown script am using at test case level. But with this i am getting the last executed test data related failed assertion messages only(means if my test case run for 10 data rows based on the datasource loop step i am getting 10th iteration execution details only.) How to get failed assertion messages for all the iterations of a test case. def step_a = ""; for (testStepResult in testRunner.getResults() ) { def testStep = testStepResult.getTestStep() step_a = step_a + "TestStep [ " + testStep.name + " ] finished with status " + testStepResult.getStatus().toString() + "\n" //log.info testStep.testRequest.response.responseHeaders if (testStep instanceof com.eviware.soapui.model.testsuite.Assertable) { for( assertion in testStep.assertionList ) { def messages = "" def isAssertionLogged = false for( message in testStepResult.getMessages() ) { if(message.contains(assertion.name)) { messages = messages + testStep.name + "- Error [" + message + "]" + "\n";; isAssertionLogged = true break } } if(isAssertionLogged) //if there is no error message for the assertion, the assertion is either passed (VALID) or was not ran (UNKNOWN) { step_a = step_a + "Assertion [" + assertion.label + "] has status [FAILED]" + "\n"; step_a = step_a + messages; } else { if(assertion.isDisabled()) { step_a = step_a + "Assertion [" + assertion.label + "] has status [UNKNOWN]" + "\n" } else { step_a = step_a + "Assertion [" + assertion.label + "] has status [OK]" + "\n" } } } } log.info( step_a) }//end for log.info "Let’s get Test run results" File file = new File("C:/Users/cn326923Results/TestRunnerStatus20.txt") file.write step_a SolvedRe: Groovy script to run the excel data source test step from groovy script Hi KarelHusa , I want script to use the loop iteration data in Groovy script (using DataSource). (what i am trying to do is, i am creating groovy class as a frame work and going to use that class method in each test case setup script, so that the entire execution will happen from that groovy only. The structure of each case is exactly same like which i mentioned in the first post. Here my question is how to achieve that through groovy script. I am getting test case name then getting all the steps, till this point its working fine after that how to run the datasource step(is there any specific syntax) and how to to make the data source loop call multiple test steps based on the datasource row count) Groovy script to run the excel data source test step from groovy script I need the Groovy script to run the below mention test case The test case which i have looks like 1 step : DataSource(Excel) 2 step: groovyScript 3 Step: restrequest 4 Step: datesink 5 Step: Datsourceloop when we run the script manually the execution will happen based on the row count of excel which we mentioned the path in the datasource step (in the execution loop the 2,3,4 steps get executed repeatedly based on the excel row count ). Same way i am looking for the groovy script which do the same execution for framework development.