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.


Last edited by anandsri01 on 07 Mar 2011 17:14, edited 1 time in total.
anandsri01
Newbie


Joined: 11 Nov 2010 14:54

1 Reply

  • anandsri01's avatar
    anandsri01
    New Contributor
    how do i replace "<![CDATA[<?xml version="1.0" encoding="UTF-8"?>" with "" , as if i can do this then i will be able to add assertion.