Forum Discussion

anandsri01's avatar
anandsri01
New Contributor
15 years ago

An Event Handler to the Rescue

Hi,

I want to add assertion on CDATA content so i use SubmitListener.afterSubmit handler. i use script -

if( submit.response == null )
return
def content = submit.response.responseContent
content = content.replaceAll( "<!\\[CDATA\\[", "" )
content = content.replaceAll( "]]>", "" )
log.info( content )
submit.response.responseContent = content


It works fine but after applying this the inside Response the "Outline" tab is blank or even when i tried to add assertion then after add Xpath Match and open select Xpath panel the it show blank.

So please help me how can i add assertions on CDATA content.

1 Reply

  • Awesome's avatar
    Awesome
    Frequent Contributor
    i had a similar problem, i found that there were "left over" chars in my xml that i also needed to parse out (otherwise the xml response had messed up tags), then soapui's outline view correctly displayed the message and i could correctly apply assertions.