Forum Discussion
It'll be your escaping that'll be the problem i'm guessing. Unfortunately my groovy escaping is rubbish...ive just looked at groovy escaping again and i still cant see why you need double \\ before the ? character in the xml declaration youre trying to remove from your soap body.
Ive used this find and replace plenty of times in my soapui projects but im not in front of my laptop right now. I'll post later with the correct escape sequence once im back in front of my laptop.
Cheers
Rich
hi richie
submitlistener.aftersubmit works as below so I use it like this for requestfilter.afterrequest.
but submitlistener.aftersubmit does not work automatically in test suite.
we got support for this but we couldn't find a solution. (submitlistener.aftersubmit)
I thought I could use the after request as a solution. so I wrote here for support.
def content = submit.response.responseContent
content = content.replaceAll("<!\\[CDATA\\[", "")
content = content.replaceAll("\\]]>", "")
content = content.replaceAll("<\\?xml version=\"1.0\" encoding=\"iso-8859-9\"\\?>", "")
log.info (content)
submit.response.responseContent = content
I would really apreciate if you help
thanks.
- richie4 years agoCommunity HeroHey hrn83au,
You lost me a little. Are you saying the groovy ran fine with one handler, but didnt with the other handler?
Ta
Rich- hrn83au4 years agoOccasional Contributor
hi richie
yes.I write the details below.
1. SubmitListener.afterSubmit
a. script is working when I run it manually. (I put the screenshot below)
b. When I run the script automatically, the test suite doesn't work.
2. we tried to solve this problem using RequestFilter.afterRequest but it doesn't work at all (a and b).
I hope I haven't confused you more. I would be very happy if you could help me
- HimanshuTayal4 years agoCommunity Hero
hrn83au :
You can use below script to fetch data from cData tag, there is no need to replace the cData Tag
import com.eviware.soapui.support.GroovyUtils def response = context.httpResponse.responseContent def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) def v=groovyUtils.getXmlHolder(response) def CDATAXml=v.getNodeValue("//*:return") //it will print cdata log.info CDATAXml def data = new XmlParser().parseText(CDATAXml) //it will print SONUC value log.info data.SONUC.text()
Hope it will help you in resolving your issue.
Related Content
- 2 years agoBrianFixzone
- 4 years agocarlomarchesoni
- 12 months agoTomA
- 6 years agogenki