Script Assertion - accessing other Test Steps...
In my test steps, I have a GET that retrieves the existing data. I'm storing the values with a Property Transfer into a Properties step. The value I will be using is "LastUpdateDate"
A groovy script is called to take the value of "IsRejected" and build up the request value for the PUT request that is called after the groovy script.
def isRejectValue = !testRunner.testCase.testSteps['TestStep1'].getPropertyValue("VaribleIsRejectedValue")
def testSteps = testRunner.testCase.getTestStepList()
for (runner in testSteps) {
if (runner.name == 'PUT httpRequest') {
def propList = runner.getPropertyList()
for (props in propList) {
if (props.name == 'Request') {
props.value = '[{\r\n "ObjectId": "58",\r\n "IsRejected": "'+ isRejectValue +'",\r\n "LastUpdateDate": "2025-01-08T16:07:23-06:00"\r\n}]'
}
}
}
}
After the PUT request, I do another GET request to get the same one I just updated, to verify the LastUpdateDate is different from the values in Properties.
I'm looking at the Script Assertion to see if I can do the check there so if the lastUpdateDate is the same, it would fail the test. My issue is how do I get to the "Properties Step" data?
Perhaps there is a better way to accomplish this, but this is the current path I'm going.
Thanks