# Conditions

Every kind of condition, for landmarks, expectations and control flow.

A condition is an object with exactly one of these keys. Conditions are written in `landmarks`, a step's `expect` and `if`, `when`, `loop_until`, `wait_for`, `scroll.until` and `paginate.stop_when`; `all`, `any` and `not` combine them.

| Condition | Type | Description |
|---|---|---|
| [`url`](https://docs.kaab.ist/reference/dsl/conditions/url) | `string or object` | True when the page URL matches a glob (`*` within a path segment, `**` across segments, `?` one character), or a regular expression given as `{ "matches": … }`. |
| [`title`](https://docs.kaab.ist/reference/dsl/conditions/title) | `object` | True when the page title matches; give exactly one of `contains`, `equals` or `matches`. |
| [`visible`](https://docs.kaab.ist/reference/dsl/conditions/visible) | `target` | True when the target exists and is visible. |
| [`hidden`](https://docs.kaab.ist/reference/dsl/conditions/hidden) | `target` | True when the target is not visible, including when it does not exist. |
| [`exists`](https://docs.kaab.ist/reference/dsl/conditions/exists) | `target` | True when the target is in the page, visible or not. |
| [`absent`](https://docs.kaab.ist/reference/dsl/conditions/absent) | `target` | True when the target is not in the page. |
| [`text`](https://docs.kaab.ist/reference/dsl/conditions/text) | `object` | True when the target's text matches; give `target` and exactly one of `contains`, `equals` or `matches`. |
| [`count`](https://docs.kaab.ist/reference/dsl/conditions/count) | `object` | True when the number of elements matching `target` satisfies the bounds; give at least one of `min`, `max` and `eq`. |
| [`network`](https://docs.kaab.ist/reference/dsl/conditions/network) | `object` | True when a response matching `url`, and `method` and `status` if given, has been observed since the step started. |
| [`var`](https://docs.kaab.ist/reference/dsl/conditions/var) | `object` | Compares a value from `inputs`, `vars`, `session` or `job` with `op` and `value`. |
| [`landmark`](https://docs.kaab.ist/reference/dsl/conditions/landmark) | `string` | True when the named entry of the program's `landmarks` holds. |
| [`all`](https://docs.kaab.ist/reference/dsl/conditions/all) | `condition[]` | True when every condition in the list holds. |
| [`any`](https://docs.kaab.ist/reference/dsl/conditions/any) | `condition[]` | True when at least one condition in the list holds. |
| [`not`](https://docs.kaab.ist/reference/dsl/conditions/not) | `condition` | True when the given condition does not hold. |
