Applies to ReadyAPI 3.0, last modified on November 19, 2019

The Not Contains assertion verifies that some specific value is missing from the message.

Availability

This assertion is available in multiple ReadyAPI applications. Depending on the application, it validates the following data:

In... Checks... To learn more...
SoapUI functional tests The request or response contents. See Working With Assertions in SoapUI.
SoapUI security tests The response contents. See Security Assertions.
ServiceV The request contents. See Assertions in ServiceV.

Create an assertion

Follow these steps:

SoapUI: The Assertions panel

Click the image to enlarge it.

  1. Open a test step.

  2. Click Add assertion.

In the New Assertions dialog, search for the Not Contains assertion or select it manually in the Property Content category.

Follow these steps:

Secure: The Assertions panel

Click the image to enlarge it.

  1. Open a security test.

  2. Select Response Assertion.

  3. Click in the Assertions panel

In the New Assertions dialog, search for the Not Contains assertion or select it manually in the Property Content category.

Follow these steps:

ServiceV: The Assertions panel

Click the image to enlarge it.

  1. Open a virtual service.

  2. Open the Assertions drop-down panel.

  3. Click in the Assertions panel

In the New Assertions dialog, search for the Not Contains assertion or select it manually in the Property Content category.

Setting up properties

  1. In the Content edit box, specify the value you expect to be absent.

    ReadyAPI: Configuring the Contains assertion

    Click the image to enlarge it.

    Use one of the following:

    • An ordinary string.

    • A regular expression.

      Note: Make sure to enable the Regular Expression option.

      To separate lines within a regular expression, use the (?m) flag. Also, mark the beginnings of the lines with ^ and the ends with $.

      To learn more about the regular expression syntax, see the Oracle Documentation.

  2. Enable additional options if you need:

    Option Description
    Ignore Case Ignore the content case during the search.
    Regular Expression Treat the value you have entered as a regular expression.
    To learn more about the syntax of regular expressions, see the Oracle documentation.

The following regular expression gets all strings where the Date value belongs to September 2014.

(?s).*<Date>2014-09-\d{2}T.{8}</Date>.*

Add more assertions for response and request contents:

See Also

Property Content Assertions
Contains Assertion
Message Content Assertion

Highlight search results