> ## 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.

# checkElementAttribute

> Element-level assertion family for an attribute on the element.

Asserts a condition on an attribute of the element. 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                                                                                  |
| --------- | --------- | --------- | -------------------------------------------------------------------------------------------- |
| `on`      | `string`  | Yes       | Target description or percent pair.                                                          |
| `name`    | `string`  | Yes       | Attribute name to check.                                                                     |
| `value`   | `string`  | Sometimes | Value to compare against. Required for every condition except `*Exists` and `*DoesNotExist`. |
| `timeout` | `number`  | No        | Milliseconds to wait for the condition to hold.                                              |
| `saveAs`  | `string`  | No        | Variable to store this step's return value on `env.<name>`.                                  |
| `retries` | `number`  | No        | Times to retry the step on failure before failing the test.                                  |
| `skipped` | `boolean` | No        | Skip this step at execution time.                                                            |

## Examples

```yaml theme={null}
- checkElementAttributeEquals:
    on: the username field
    name: value # the attribute to read
    value: jeff@example.com # the value it must equal
```

```yaml theme={null}
- checkElementAttributeDoesNotExist:
    on: the badge
    name: data-disabled
```

## Notes

Aliases supported by this family:

| Alias                                   |
| --------------------------------------- |
| `checkElementAttributeExists`           |
| `checkElementAttributeDoesNotExist`     |
| `checkElementAttributeContains`         |
| `checkElementAttributeDoesNotContain`   |
| `checkElementAttributeEquals`           |
| `checkElementAttributeDoesNotEqual`     |
| `checkElementAttributeStartsWith`       |
| `checkElementAttributeDoesNotStartWith` |

## Related

* [Test format](/core-concepts/test-format)
