# Compare

A **compare assertion** is used to compare 2 values. There is such thing as in this assertion type as comparator - an operation that compares two values. There are several comparator types:

* **equal** - checks if the values are equal;
* **not equal** - checks if the values are not equal;
* **greater** - checks if the current value is greater than the expected one;
* **greater or equal** - checks if the current value is greater than or equal to the expected one;
* **less** - checks if the current value is less than the expected one;
* **less or equal** - checks if the current value is less than or equal to the expected one.

The **compare** assertion interface is as follows:

![The compare assertion interface](/files/-LgrGVxEU1ocjiTPcusu)

The following fields are shown in the screenshot:

* **Actual value**;
* **Operator** - the comparator type;
* **Expected value**.

### Error Fixing

The error fixing algorithm depends on the comparator type.

* **equal** -  the current value is assigned to the expected one;
* **not equal** - the comparator type changes to equal;
* **greater** - the comparator type changes to greater or equal and the current value is assigned to the expected one;
* **greater or equal** - the current value is assigned to the expected one;
* **less** - the comparator type changes to less or equal and the current value is assigned to the expected one;
* **less or equal** - the current value is assigned to the expected one.

### File Representation

The assertion has the `compare` type in the file. The type description can be found in the [Assertion file representation](/master/node-types/assertion-node.md#failovoe-predstavlenie) documentation in the `#/definitions/CompareAssertion` 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/master/node-types/assertion-node/untitled.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.
