groovyguy
3 years agoCommunity Hero
ReadyAPI 3.30.0 - Intermittent issues with saving data to a properties step via groovy
Running into an issue and wanted to see if anyone else has experienced this. It's cropped up for myself and some of my team members in ReadyAPI 3.30.0. With some of the services we test, we have to save data out of the response and up until this version (we mostly used 2.3.0 until this upgrade), everything worked fine with a script like below. This works as a groovy script assertion, until it doesn't, and starts failing with "Error in assertion script of the [<TestStep Name>] test step: Index 4 out of bounds for length 4."
The reason I am asking this is because if I close and restart ReadyAPI, the script assertion works again. But given enough time, it or another like it will fail. Thoughts? Any help is much appreciated.
import com.eviware.soapui.support.XmlHolder
import groovy.util.*
def holder=groovyUtils.getXmlHolder(messageExchange.responseContentAsXml)
def currValue = holder["//xpath/to/value/to/save/Identifier"]
context.testCase.testSuite.testCases["Properties"].testSteps["Properties"].setPropertyValue("PropertyName", currValue)