+

Search Tips   |   Advanced Search


Add Xpath query verification points

With service query verification points, you can check that a message return matches an Xpath query.

When you add verification points, the results from a service message return are compared with the expected data that is specified in the verification point test element. With query verification points, you can check that the number of nodes returned by an XML Path language query matches the expected number of nodes specified in the verification point.

Refer to the XPath specification for details on expressing an XPath query: http://www.w3.org/TR/xpath.

You can use the test editor to create or edit verification points. To add Xpath query verification points to a service test:

  1. Open the test editor, and select a Web service message return element.

  2. Click Add, and select Query verification point.

  3. In the Test Element Details area of the test editor, type a name for the verification point.

  4. Type a valid XPath expression or click Build Expression to open the XPath Expression Builder. The XPath Expression Builder helps you build and evaluate XPath expressions based on the recorded contents of the message return.

  5. Specify a Comparison operator (=, >, or <), and the expected number of nodes that the query should return. Click Evaluate to update the Expected Count with the actual result based on the recorded contents of the message return.


What to do next

You can enable or disable each Web service verification point by clicking Enable verification point in the test editor.

Because XPath expressions require that the qualified name have a prefix, XPath expressions will return null for the default namespace declared with xmlns.


Related tasks

  • Verify application behavior
  • Add attachment verification points
  • Add equal verification points
  • Add contain verification points