> For the complete documentation index, see [llms.txt](https://docs.pylenium.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pylenium.io/elements-commands/elements.should.md).

# Elements.should()

A collection of expected conditions against a list of Elements

## Expectations

### Positive Conditions

* <mark style="color:purple;">`.be_empty()`</mark>
* <mark style="color:purple;">`.have_length(length: int)`</mark>
* <mark style="color:purple;">`.be_greater_than(length: int)`</mark>
* <mark style="color:purple;">`.be_less_than(length: int)`</mark>

### Negative Conditions

* <mark style="color:purple;">`.not_be_empty()`</mark>

## Syntax

```python
# use the default wait_time
Elements.should().<expectation>

---or---

# customize the wait_time for this expectation
Elements.should(timeout: int).<expectation>

---or---

# ignore exceptions that you expect to "get in the way"
Elements.should(ignored_exceptions: list).<expectation>

---or---

# customize both fully
Elements.should(timeout: int, ignored_exceptions: list).<expectation>
```

## Examples

{% code title=".has\_length()" %}

```python
def test_about_menu_has_3_links(py):
    py.visit("https://qap.dev")
    about = py.get("a[href='/about']")
    about.hover()
    assert about.find("a").should().have_length(3)
```

{% endcode %}

{% code title=".not\_be\_empty()" %}

```python
def test_page_has_at_least_one_checkbox(py):
    py.visit("https://the-internet.herokuapp.com/checkboxes")
    assert py.find("[type='checkbox']").should().not_be_empty()
```

{% endcode %}
