# Should / Expected Conditions

Pylenium's [*<mark style="color:orange;">**Driver**</mark>*](/driver-commands/should.md), [*<mark style="color:orange;">**Element**</mark>*](/element-commands/should.md), and [*<mark style="color:orange;">**Elements**</mark>*](/elements-commands/elements.should.md) objects each have a **`Should`** API that allows you to write fluent-like code to wait and check for any expected conditions.

For example, to check that an element is visible on the webpage, you would do this:

{% code title="Pylenium" %}

```python
def test_element_is_visible(py):
    py.visit("https://qap.dev")
    assert py.get("a[href='/about']").should().be_visible()
```

{% endcode %}

With Selenium, you normally use the **`ExpectedConditions`** class:

{% code title="Selenium" %}

```python
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait


def test_element_is_visible():
    driver = webdriver.Chrome()
    wait = WebDriverWait(driver, timeout=10)
    
    driver.get("https://qap.dev")
    element = wait.until(EC.visibility_of_element_located(By.CSS_SELECTOR, "a[href='/about']"))
    assert element.is_displayed()
```

{% endcode %}

### Similar Pages

* [*<mark style="color:orange;">**Driver.should()**</mark>*](/driver-commands/should.md)
* [*<mark style="color:orange;">**Element.should()**</mark>*](/element-commands/should.md)
* [*<mark style="color:orange;">**Elements.should()**</mark>*](/elements-commands/elements.should.md)


---

# 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.pylenium.io/guides/should-expected-conditions.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.
