Forum Discussion

hazel_chua's avatar
4 years ago

Trying to retrieve a property based on the value of another property in the Properties test step

I have 2 Properties test steps set up in one of my test suites.  And right now I need to retrieve values from the 2nd Properties test step based on a serial number from the first Properties test step...
  • hazel_chua's avatar
    3 years ago

    eventually this is what I ended up doing : 



    	if(incCount == true)
    		//Count the number of times an account number is used for financial transactions on the day and 
    		//updated the "Count" in the Settlements property step
    		def propertySettlements = testRunner.testCase.getTestStepByName("Settlements")
    		paddingNum = propertySettlements.getPropertyValue("DataRowCount").length()
    		for(def testProperty in propertySettlements.getPropertyList())
    			if(accnum in testProperty.value)
    				def padFlag =
    				int newVal = propertySettlements.getPropertyValue("Count " + padFlag).toInteger()
    				propertySettlements.setPropertyValue("Count " + padFlag, newVal.toString())