mercredi 16 septembre 2020

Auto-increment Custom Properties for SOAPUI testing

def TransID = testRunner.testCase.testSuite.project.getPropertyValue("TransID")
def TransIDInc = TransID.toInteger()+1 
testRunner.testCase.testSuite.project.setPropertyValue("TransID",TransIDInc.toString())
//checkin..
log.info testRunner.testCase.testSuite.project.getPropertyValue("TransID")

I want to autoincrement this custom property, and after research and viewing similar issues such as Auto-increment Custom Properties for SOAPUI testSuite I have tried this solution and created this custom property called TransID which is shown in my request message as "id": "${#TransID}" , but whenever i run the groovy script i get log message that value is null thus cannot increment a null value. Does this mean my value is not read from the custom properties?.

Aucun commentaire:

Enregistrer un commentaire