harry21
8 years agoOccasional Contributor
Getting MissingMethodException while calling Groovy class in a script
Below is the groovy script which I would like to convert into reusable Groovy class def resp = context.testCase.getTestStepByName(retrieveSequenceNumberAfter).getPropertyValue("ResponseAsXml")
d...
- 8 years ago
Below is the class for Script Library:
package com.linos.readyapi.util.transaction class Utility { static def getData(response, element) { assert response, 'response is empty' def pXml = new XmlSlurper().parseText(response) pXml.'**'.findAll {it.name() == element} } }
In the Script Assertion, use below statements:
import static com.linos.readyapi.util.transaction.Utility.getData log.info "Details from response: ${getData(context.response, 'transaction_id')}"