Forum Discussion

arupacharya1784's avatar
arupacharya1784
Occasional Contributor
7 years ago

How to handle bulleted points in Response as Contains assertions

Hi,

 

One of Responses has texts in bullted points as 

"<![CDATA[<ul><li>arup4</li><li>arup3</li><li>arup2</li><li>Arup1</li></ul>]]>"

Above, arup4 arup3 arup2 Arup1 are technical texts but in bulleted points.

 

I am trying to match these values via Groovy scripting. How do I achieve that? If i copy paste everything  & compare the response (stored in varaiable), it doesn't match because of bulleted points values as ![CDATA[<ul><li>, etc.

 

I am using SOAPUI Pro 5.0.2. If not groovy & something from tool also that will do.

 

Please suggest/guide.

2 Replies

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Is this an XML response or HTML? If it's XML, you could use the XQuery Match assertion.

     

    For example, if the XML looks like

    <root>
        <some_data>
            <![CDATA[<ul><li>arup4</li><li>arup3</li><li>arup2</li><li>Arup1</li></ul>]]>
        </some_data>
    </root>

    XQuery Expression:

    saxon:parse(//some_data)

    Expected result - click Select from current. It'll be something like:

    <ul>
     <li>arup4</li>
     <li>arup3</li>
     <li>arup2</li>
     <li>Arup1</li>
    </ul>