Script mode can become jumpy with large amounts of variables and statements

Script mode cant seem to handle an excessive load of variables and statements at once. Not sure if anyone else experiences this. We are testing our API and veriify 187 fields, declaring each as a variable and cross checking with the DB. Im maybe a third of the way and am now encountering these issues. This is just an intimittent issue as most of the time it works fine but have experienced moments of the page completely messing up and displaying statments in all different positions :crazy_face:

script so far

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import java.awt.TexturePaintContext.Int

import org.apache.poi.hpsf.Decimal

import com.google.api.client.util.DateTime
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

import internal.GlobalVariable as GlobalVariable

def response = WS.sendRequestAndVerify(findTestObject('GET/Persrec'))

CustomKeywords.'db.sql.connectDB'(GlobalVariable.dataBase, GlobalVariable.dataBaseUsername, GlobalVariable.dataBasePW)

def persrec = CustomKeywords.'db.sql.executeQuery'('SELECT * FROM Persrec WHERE PerID IN (1)')
def persrecApi = CustomKeywords.'db.sql.executeQuery'('SELECT * FROM ApiPersrecView WHERE PerID IN (1)')

def row = -1

while (persrec.next())
{
	row++
	
	String name = persrec.getObject('PerName')
	String knownAs = persrec.getObject('PerKnownAs')
	String absYearID = persrec.getObject('PerAbsYearID')
	String addressDateFrom = persrec.getObject('PerAddressDateFrom')
	String addressLine1 = persrec.getObject('PerAddressLine1')
	String addressLine2 = persrec.getObject('PerAddressLine2')
	String addressLine3 = persrec.getObject('PerAddressLine3')
	String addressLine4 = persrec.getObject('PerAddressLine4')
	String appRefNo = persrec.getObject('PerAppRefNo')
	String basicPay = persrec.getObject('PerBasicPay')
	String carRegNumber = persrec.getObject('PerCarRegNumber')
	String ccRejectionsToMe = persrec.getObject('PerccRejectionsToMe')
	//String cFnumber1 = persrec.getObject('PerCFnumber1')
	String companyCar = persrec.getObject('PerCompanyCar')
	//String contStartDate = persrec.getObject('PerContStartDate')
	String contractEnd = persrec.getObject('PerContractEnd')
	String contService = persrec.getObject('PerContService')
	String countryID = persrec.getObject('PerCountryID')
	String currencyID = persrec.getObject('PerCurrencyID')
	//String DateFrom = persrec.getObject('PerDateFrom')
	//String DateLeft = persrec.getObject('PerDateLeft')
	//String DateOfBirth = persrec.getObject('PerDateOfBirth')
	//String DateToGrade = persrec.getObject('PerDateToGrade')
	String EmployeeNoticePeriod = persrec.getObject('PerEmployeeNoticePeriod')
	String EmployeeNumber = persrec.getObject('PerEmployeeNumber')
	String EmployerNoticePeriod = persrec.getObject('PerEmployerNoticePeriod')

	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].Name", name)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].KnownAs" , knownAs)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].AbsYearID" , absYearID )
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].AddressDateFrom" , addressDateFrom)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].AddressLine1" , addressLine1)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].AddressLine2" , addressLine2)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].AddressLine3" , addressLine3)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].AddressLine4" , addressLine4)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].AppRefNo" , appRefNo)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].BasicPay" , basicPay)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].CarRegNumber" , carRegNumber)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].ccRejectionsToMe" , ccRejectionsToMe)
	//WS.verifyElementPropertyValue(response, "PersonDetail[${row}].CFnumber1" , cFnumber1)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].CompanyCar" , companyCar)
	//WS.verifyElementPropertyValue(response, "PersonDetail[${row}].ContStartDate" , contStartDate)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].ContractEnd" , contractEnd)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].ContService" , contService)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].CountryID" , countryID)
	//WS.verifyElementPropertyValue(response, "PersonDetail[${row}].DateFrom" , DateFrom)
	//WS.verifyElementPropertyValue(response, "PersonDetail[${row}].DateLeft" , DateLeft)
	//WS.verifyElementPropertyValue(response, "PersonDetail[${row}].DateOfBirth" , DateOfBirth)
	//WS.verifyElementPropertyValue(response, "PersonDetail[${row}].DateToGrade" , DateToGrade)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].EmployeeNoticePeriod" , EmployeeNoticePeriod)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].EmployeeNumber" , EmployeeNumber)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row}].EmployerNoticePeriod" , EmployerNoticePeriod)

	
}

def row1 = -1

while (persrecApi.next())
{
	row1++
	
	String country = persrecApi.getObject('Country')
	String currentAnnualPay = persrecApi.getObject('CurrentAnnualPay')
	String currentChangeReason = persrecApi.getObject('CurrentChangeReason')
	String currentChangeReasonID = persrecApi.getObject('CurrentChangeReasonID')
	String currentContract = persrecApi.getObject('CurrentContract')
	String CurrentContractEndDate = persrecApi.getObject('CurrentContractEndDate')
	String CurrentContractID = persrecApi.getObject('CurrentContractID')
	String CurrentCostcentreACode = persrecApi.getObject('CurrentCostcentreACode')
	String CurrentCostcentreADescription = persrecApi.getObject('CurrentCostcentreADescription')
	String CurrentCostCentreAID = persrecApi.getObject('CurrentCostCentreAID')
	String CurrentCostCentreAPercent = persrecApi.getObject('CurrentCostCentreAPercent')
	String CurrentCostcentreBCode = persrecApi.getObject('CurrentCostcentreBCode')
	String CurrentCostcentreBDescription = persrecApi.getObject('CurrentCostcentreBDescription')
	String CurrentCostCentreBID = persrecApi.getObject('CurrentCostCentreBID')
	String CurrentCostCentreBPercent = persrecApi.getObject('CurrentCostCentreBPercent')
	String CurrentFTE = persrecApi.getObject('CurrentFTE')
	String CurrentGrade = persrecApi.getObject('CurrentGrade')
	String CurrentGradeID = persrecApi.getObject('CurrentGradeID')
	//String CurrentGradeStartDate = persrecApi.getObject('CurrentGradeStartDate')
	String CurrentHomeCurrencyBasicPay = persrecApi.getObject('CurrentHomeCurrencyBasicPay')
	String CurrentHourlyRate = persrecApi.getObject('CurrentHourlyRate')
	String CurrentHours= persrecApi.getObject('CurrentHours')
	String CurrentJobClassification = persrecApi.getObject('CurrentJobClassification')
	String CurrentJobclassificationID = persrecApi.getObject('CurrentJobclassificationID')
	String CurrentJobEndDate = persrecApi.getObject('CurrentJobEndDate')
	String CurrentJobID = persrecApi.getObject('CurrentJobID')
	String CurrentJobNumber = persrecApi.getObject('CurrentJobNumber')
	String CurrentJobPayID = persrecApi.getObject('CurrentJobPayID')
	String CurrentJobPayJobChangeFlag = persrecApi.getObject('CurrentJobPayJobChangeFlag')
	String CurrentJobPayLeaverFlag = persrecApi.getObject('CurrentJobPayLeaverFlag')
	String CurrentJobPayNotes = persrecApi.getObject('CurrentJobPayNotes')
	String CurrentJobPayStarterFlag = persrecApi.getObject('CurrentJobPayStarterFlag')
	//String CurrentJobStartDate = persrecApi.getObject('CurrentJobStartDate')
	String CurrentJobTitle = persrecApi.getObject('CurrentJobTitle')
	String CurrentLocation = persrecApi.getObject('CurrentLocation')
	String CurrentLocationID = persrecApi.getObject('CurrentLocationID')
	String CurrentOrgUnit1ID = persrecApi.getObject('CurrentOrgUnit1ID')
	String CurrentOrgUnit1Name = persrecApi.getObject('CurrentOrgUnit1Name')
	String CurrentOrgUnit2Name = persrecApi.getObject('CurrentOrgUnit2Name')
	String CurrentOrgUnit3Name = persrecApi.getObject('CurrentOrgUnit3Name')
	String CurrentOrgUnit4Name = persrecApi.getObject('CurrentOrgUnit4Name')
	String CurrentOrgUnit5Name = persrecApi.getObject('CurrentOrgUnit5Name')
	String CurrentPayBasis = persrecApi.getObject('CurrentPayBasis')
	String CurrentPayFrequency = persrecApi.getObject('CurrentPayFrequency')
	String CurrentSalary = persrecApi.getObject('CurrentSalary')
	String CurrentSalaryCurrency = persrecApi.getObject('CurrentSalaryCurrency')
	String CurrentSickPayCode = persrecApi.getObject('CurrentSickPayCode')
	String CurrentWeeksInYear = persrecApi.getObject('CurrentWeeksInYear')
	String CurrentWorkpattern = persrecApi.getObject('CurrentWorkpattern')
	String CurrentWorkpatternID = persrecApi.getObject('CurrentWorkpatternID')
	String EthnicOriginCode = persrecApi.getObject('EthnicOriginCode')

	
	
	
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].Country" , country)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentAnnualPay" , currentAnnualPay)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentChangeReason" , currentChangeReason)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentChangeReasonID" , currentChangeReasonID)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentContract" , currentContract)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentContractEndDate" , CurrentContractEndDate)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentContractID" , CurrentContractID)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentCostcentreACode" , CurrentCostcentreACode)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentCostcentreADescription" , CurrentCostcentreADescription)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentCostCentreAID" , CurrentCostCentreAID)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentCostCentreAPercent" , CurrentCostCentreAPercent)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentCostcentreBCode" , CurrentCostcentreBCode)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentCostcentreBDescription" , CurrentCostcentreBDescription)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentCostCentreBID" , CurrentCostCentreBID)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentCostCentreBPercent" , CurrentCostCentreBPercent)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentFTE" , CurrentFTE)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentGrade" , CurrentGrade)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentGradeID" , CurrentGradeID)
	//WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentGradeStartDate" , CurrentGradeStartDate)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentHomeCurrencyBasicPay" , CurrentHomeCurrencyBasicPay)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentHourlyRate" , CurrentHourlyRate)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentHours" , CurrentHours)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentJobclassificationID" , CurrentJobclassificationID)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentJobEndDate" , CurrentJobEndDate)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentJobID" , CurrentJobID)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentJobNumber" , CurrentJobNumber)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentJobPayID" , CurrentJobPayID)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentJobPayJobChangeFlag" , CurrentJobPayJobChangeFlag)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentJobPayLeaverFlag" , CurrentJobPayLeaverFlag)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentJobPayNotes" , CurrentJobPayNotes)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentJobPayStarterFlag" , CurrentJobPayStarterFlag)
	//WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentJobStartDate" , CurrentJobStartDate)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentJobTitle" , CurrentJobTitle)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentLocation" , CurrentLocation)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentLocationID" , CurrentLocationID)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentOrgUnit1ID" , CurrentOrgUnit1ID)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentOrgUnit1Name" , CurrentOrgUnit1Name)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentOrgUnit2Name" , CurrentOrgUnit2Name)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentOrgUnit3Name" , CurrentOrgUnit3Name)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentOrgUnit4Name" , CurrentOrgUnit4Name)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentOrgUnit5Name" , CurrentOrgUnit5Name)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentPayBasis" , CurrentPayBasis)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentPayFrequency" , CurrentPayFrequency)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentSalary" , CurrentSalary)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentSalaryCurrency" , CurrentSalaryCurrency)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentSickPayCode" , CurrentSickPayCode)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentWeeksInYear" , CurrentWeeksInYear)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentWorkpattern" , CurrentWorkpattern)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].CurrentWorkpatternID" , CurrentWorkpatternID)
	WS.verifyElementPropertyValue(response, "PersonDetail[${row1}].EthnicOriginCode" , EthnicOriginCode)

	

	
	
	
	
}

UPDATE - Im now constantly recieveing operation in progress and parsing script after every line added. Its nearly becoming un workable with how slow its becoming.

1 Like

Yep, it’s a memory issue. My Kat sessions ALWAYS end up like this resulting in a crash eventually. There are no workarounds I know of, but these may help:

  1. Save often (Ctrl-S, Ctrl-S, Ctrl-S…) it will drive you crazy.

  2. Turn off JavaDoc. There’s something wrong in there somewhere.

See also:

And you can try doing this to help @devalex88 try to find the cause(s).

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.