Applies to ReadyAPI 2.7, last modified on May 14, 2019

The HTTP Header Equals assertion checks whether the header exists in the request or response and has the value you need.

This assertion works with test steps and virtual APIs that receive HTTP messages.

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 header. See Working With Assertions in SoapUI.
SoapUIĀ security tests The response header. See Security Assertions.
ServiceV The request header. 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 HTTP Header Equals assertion or select it manually in the Compliance, Status and Standards 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 HTTP Header Equals assertion or select it manually in the Compliance, Status and Standards 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 HTTP Header Equals assertion or select it manually in the Compliance, Status and Standards category.

Setting up properties

  1. Specify the header name in the Header field.

    ReadyAPI: Configuring the HTTP Header Equals assertion
  2. Specify the expected header value in the Value edit box.

  3. Select additional options to narrow down the expected value:

    Option Description
    Ignore case Make the search case insensitive.
    Regular Expression Treat the entered value as a regular expression.
    To learn more about the syntax of regular expressions, see the Oracle documentation.

Add more assertions for HTTP status codes and response headers:

See Also

Compliance, Status and Standards Assertions
Header Exists Assertion

Highlight search results