> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# checkElement

> Element-level assertion family for the element itself.

Asserts a condition on the element itself. Each alias is its own single-key
command. There is no separate `condition` or `negated` field. The positive and
negative variants map directly to the table below.

## Parameters

| Parameter | Type                 | Required | Description                                                                                            |
| --------- | -------------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| `element` | `string`             | No       | Natural-language description of the target. Use exactly one of `element`, `css`, `coords`, or `x`/`y`. |
| `css`     | `string`             | No       | CSS selector for the target. Use instead of the description key.                                       |
| `coords`  | `string \| { x, y }` | No       | Absolute viewport coordinates. Either an `x, y` string (e.g. `120, 40`) or a `{ x, y }` object.        |
| `x`       | `number \| string`   | No       | X coordinate. Must be provided together with `y`.                                                      |
| `y`       | `number \| string`   | No       | Y coordinate. Must be provided together with `x`.                                                      |
| `force`   | `boolean`            | No       | Force the action even when the element is not actionable.                                              |
| `iframe`  | `string`             | No       | URL or URL pattern of the iframe that contains the target element.                                     |
| `timeout` | `number`             | No       | Maximum time in milliseconds to wait for the condition to hold.                                        |
| `saveAs`  | `string`             | No       | Name of the variable to write this step's return value to.                                             |
| `retries` | `number`             | No       | Number of times to retry the step on failure before failing the test.                                  |
| `skipped` | `boolean`            | No       | Skip this step at execution time.                                                                      |

## Shorthand

When the alias takes no extra fields (e.g. `Exists`, `Visible`), the value can
be a single target string.

```yaml theme={null}
- checkElementVisible: Save button
```

## Examples

```yaml theme={null}
- checkElementVisible: the 'view code' button
```

```yaml theme={null}
- checkElementVisible:
    element: the Delayed action button
    timeout: 16000 # poll for up to 16s before failing
```

```yaml theme={null}
- checkElementVisible:
    element: the paragraph with the text about clicking the button from iframe 1
    iframe: https://bit.ly/38erOdQ # scope the lookup to this iframe
```

```yaml theme={null}
- checkElementEnabled:
    element: api key link
    timeout: 30000
```

```yaml theme={null}
- checkElementDoesNotExist:
    css: "#processing" # target by CSS selector instead of a description
```

```yaml theme={null}
- checkElementNotVisible:
    element: "{{ env.NON_PLAN }} column in the pricing table"
    DANGEROUS_FORCE_DYNAMIC: true # re-evaluate every run, skipping the step cache
```

```yaml theme={null}
- checkElementFocused: username input
```

```yaml theme={null}
- checkElementEditable: enabled input
```

## Notes

Aliases supported by this family:

| Alias                      |
| -------------------------- |
| `checkElementExists`       |
| `checkElementDoesNotExist` |
| `checkElementVisible`      |
| `checkElementNotVisible`   |
| `checkElementEnabled`      |
| `checkElementNotEnabled`   |
| `checkElementEditable`     |
| `checkElementNotEditable`  |
| `checkElementFocused`      |
| `checkElementNotFocused`   |

## Related

* [Writing assertions](/core-concepts/writing-assertions)
* [Finding elements](/core-concepts/finding-elements)
* [Test format](/core-concepts/test-format)
