Forum Discussion
nmrao
Champion Level 3
Difficult to check without the details of the error.
By the way, you can try:
def str = context.expand('{RegistrationRequest#Response}')
By the way, you can try:
def str = context.expand('{RegistrationRequest#Response}')
Oct21
6 years agoOccasional Contributor
nmrao Yes, it worked fine with static XML.
Please see the screenshot for error details.
Thanks
Oct21
- nmrao6 years agoChampion Level 3Ok did you try the other reply?
- Oct216 years agoOccasional Contributor
Hi nmrao
I tried the updated reponse response, and this too throwing error. It is working fine with fixed xml.
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) def str = context.expand('{RegistrationRequest#Response}') def xml = new XmlSlurper().parseText(str) def getOrderRef = { element -> xml.'**'.find {it.name() == element}.@orderItemRef } def elements = ['Assessment', 'Report'] elements.each { log.info getOrderRef(it) }
See the screeshot for error.
Thanks,
Oct21
- nmrao6 years agoChampion Level 3Error is nothing to do with script. You need to check what response have you got.
Related Content
Recent Discussions
- 6 days agoruchisingh