/* Property Names
1.UserIcre
2.JobIdIcre
3.UserNameProp
4.PasswordProp
5.MaxLimit
*/
def deviceNo = context.expand( '${HelloSource#DeviceNo}' );
def userLimit = context.expand( '${HelloSource#UserLimit}' );
def userName = context.expand( '${HelloSource#UserName}' );
//To compose UUID
def serialNumber = context.expand( '${HelloSource#SerialNumber}' )
def modelName = context.expand( '${HelloSource#ModelName}' )
def UUID="SN"+serialNumber+"MN"+modelName;
//TO Compose JOB ID
def jobCom="SN"+serialNumber+"JB00000";
//JOBID format :SN9000035X00JB000000
// SN8506666X00JB000000961
//To set the starting value of the JobID
def preJobId=testRunner.testCase.getPropertyValue("JobIdIncre");
int pJobID;
if(preJobId != null)
{
//It will display the current JobId if JobId Already exist
pJobID=Integer.parseInt(preJobId);
}else{
//To set the starting value as '1'
pJobID=1;
testRunner.testCase.setPropertyValue( "JobIdIncre",pJobID.toString() );
}
int uLimit = Integer.parseInt(userLimit);
int devNo=Integer.parseInt(deviceNo);
//log.info "userLimit:"+uLimit+"DevNO:"+devNo;
devNo=devNo-1;
testRunner.testCase.setPropertyValue( "UserNameProp",userName+((devNo*uLimit)+1) );
testRunner.testCase.setPropertyValue( "PasswordProp",userName+((devNo*uLimit)+1) );
testRunner.testCase.setPropertyValue( "UserIncre",((devNo*uLimit)+1).toString() );
testRunner.testCase.setPropertyValue( "MaxLimit",((devNo*uLimit)+uLimit).toString());
testRunner.testCase.setPropertyValue( "UUID",UUID);
testRunner.testCase.setPropertyValue( "JobID",jobCom);
return "Starting JobID::"+pJobID;
No comments:
Post a Comment