# XPath

**XPath assertion** allows to verify the response message with an XPath expression match.

This assertion interface is as follows:

![](https://1550208191-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYfhIaTTw23Sf3L5jfe%2F-LgrKP3zFd8Pe9rytuu8%2F-LgrOGxjrh9Cw-cjXRFN%2F10.png?alt=media\&token=9e0c10ae-4a20-48ad-b946-23c284ba3b7d)

This assertion interface is as follows:

* **Text** - the text to find the value in;
* **Path** - an XPath selector;
* **Expected value** - the value that should be matched.
* The **Use negative statement** flag means using the opposite assertion result, i.e. there should be no values for the specified selector in the text.

### Error Fixing

To get rid of an error, the XPath selector value is assigned to the expected value.

### File Representation

The assertion has the `xpath` type in the file. The type description can be found in [Assertion file representation](https://docs.testmace.com/node-types/assertion-node#file-representation) Assertion file representation documentation in the `#/definitions/ScriptAssertion` definition.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.testmace.com/node-types/assertion-node/xpath.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
