import com.eviware.soapui.model.testsuite.TestRunner.Status
import com.eviware.soapui.model.testsuite.TestStepResult;
def i = 0;
def results=testRunner.getResults()
def reve=results.reverse()
def UserIDResult;
def DeviceIDResult;
def JoblogResult;
def UserServiceIDResult;
def GroupIDResult;
def joblogcountTResult;
def joblogtotalTResult;
def joblogdetailTResult;
def joblogspecialTResult;
def joblogextendTResult;
for( r in reve )
{ i++;
if (i==12) {break}
if(r.testStep.name =='Verify_joblogextend_table')
{ joblogextendTResult= r.status.toString()}
else if(r.testStep.name =='Verify_joblogspecial_table')
{ joblogspecialTResult= r.status.toString()}
else if(r.testStep.name =='Verify_joblogtotal_table')
{ joblogtotalTResult= r.status.toString()}
else if(r.testStep.name =='Verify_joblogdetails_table')
{ joblogdetailTResult= r.status.toString()}
else if(r.testStep.name =='Verify_Joblogcount_table')
{ joblogcountTResult= r.status.toString()}
else if(r.testStep.name =='UserServcieIDCheck')
{ UserServiceIDResult= r.status.toString()}
else if(r.testStep.name =='GroupIDCheck')
{ GroupIDResult= r.status.toString()}
else if(r.testStep.name =='UserIDCheck')
{ UserIDResult= r.status.toString()}
else if(r.testStep.name =='DeviceIDCheck')
{ DeviceIDResult=r.status.toString()}
else if(r.testStep.name =='JoblogCheck')
{ JoblogResult=r.status.toString()/*;if(r.status.toString()=='FAILED'){def msg=r.getMessages(); log.fatal ""+msg[0]+msg[1]}*/}
else {log.fatal "Prasad:StepName condition missed :and actual TestName is "+r.testStep.name}
}
//To Set the ResultProp
def TC=testRunner.getTestCase().getTestStepByName( "ResultProp" )
TC.setPropertyValue("JoblogResult",JoblogResult);
TC.setPropertyValue("DeviceIDResult",DeviceIDResult);
TC.setPropertyValue("UserIDResult",UserIDResult);
TC.setPropertyValue("GroupIDResult",GroupIDResult);
TC.setPropertyValue("UserServiceIDResult",UserServiceIDResult);
TC.setPropertyValue("joblogcountTResult",joblogcountTResult);
TC.setPropertyValue("joblogdetailTResult",joblogdetailTResult);
TC.setPropertyValue("joblogtotalTResult",joblogtotalTResult);
TC.setPropertyValue("joblogspecialTResult",joblogspecialTResult);
TC.setPropertyValue("joblogextendTResult",joblogextendTResult);