Forum Discussion
I am trying to get the status of all test cases from all the testsuites under the project teardown after completing the testRun
https://stackoverflow.com/questions/41700437/creating-a-test-report-from-project-level-tear-down-script
- 6786 years agoRegular Contributor
appreciate your reply but, can you take a look my script and help me what i need to change based on this below comment
"not mapped out the testSuites. You will have to map out the test suites the same way you mapped out the test cases."
- 6786 years agoRegular Contributor
Added project Map but still getting error
Here is updated code :
import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus
import com.eviware.soapui.model.testsuite.TestRunner.Status
import com.eviware.soapui.impl.wsdl.*
import com.eviware.soapui.impl.wsdl.testcase.*
import com.eviware.soapui.model.testsuite.*def projectMap = [:]
def projectStatusMap = [:]
def testCaseMap = [:]
def testCaseStatusMap = [:]
testSuite.testCaseList.each{def reportMap=[:]
it.testSteps.each{def testCaseStatus =true
try{reportMap << [(it.value.name):(it.value.getAssertionStatus().toString())]
tempStatus = (it.value.getAssertionStatus().toString()=='PASS')?true:false
testCaseStatus = testCaseStatus && tempStatustestSuite.setPropertyValue("Status", testCaseStatus.toString())
}catch (e){
//log.info e
}
}
testCaseStatus = testSuite.getPropertyValue("Status")
def testCaseStatusStr = (testCaseStatus=='true')?'PASS': 'FAIL'testCaseStatusMap << [(it.name):(testCaseStatusStr.toString())]
}- nmrao6 years agoChampion Level 3Have you tried as is first?