Forum Discussion

brunoagresta's avatar
brunoagresta
New Contributor
13 years ago

How to check if string is three times in the response

Hi,
I'm new in SoapUI, I want to make a Assertion that check if in the Soap response is included a string three times.
I suppose that make a Script Assertion, could be the solution but I don't know how to do it.

Someone could help me with this little problem ?

Thanks a lot !!
Bruno Agresta.
  • Solved ! In the "Script Assertion"

    def Item = context.expand('${#Project#AuthorizedItem}')
    log.info("Item---> " + Item + " <----")
    def message = messageExchange.responseContent
    assert message.count(Item) >= 3