DMc-Cabe
11 years agoOccasional Contributor
Pass values between groovy assertions ?
I'm trying to figure out if it's possible to pass values returned from one groovy assertion to another assertion on a separate test step ?
the example I have is as follows
test step1 - is a jdbc request which queries a certain table. The assertion traverses through the response for certain row values performs an assertion and creates a collection/Array with these values
test step2 - is another jdbc request which queries a separate table. The rows values i'm interested in on this request should match those which were returned in step1.
I was hoping to be able to pass the collection/array values returned from step1 into step2 so that I could do an assert containsAll between the 2 collections/Arrays.
Is something like this even possible?
testRunner.testCase.getTestStepByName wont work because it will only pass the values to the test step and not the assertion within the test step.
I've been looking at messageExchange.modelItem.testStep but can't figure out how to pass the Array value from there either
appreciate any help with this
the example I have is as follows
test step1 - is a jdbc request which queries a certain table. The assertion traverses through the response for certain row values performs an assertion and creates a collection/Array with these values
test step2 - is another jdbc request which queries a separate table. The rows values i'm interested in on this request should match those which were returned in step1.
I was hoping to be able to pass the collection/array values returned from step1 into step2 so that I could do an assert containsAll between the 2 collections/Arrays.
Is something like this even possible?
testRunner.testCase.getTestStepByName wont work because it will only pass the values to the test step and not the assertion within the test step.
I've been looking at messageExchange.modelItem.testStep but can't figure out how to pass the Array value from there either
appreciate any help with this