Skip to content

browser.wait.until.page_title#

Functions#

changes(baseline_text, timeout=None) #

Wait until the page title changes compared to a baseline text, e.g. after a page reload or update.

Parameters:

Name Type Description Default
baseline_text str

Baseline text to compare current page title against. It's evaluated as any change.

required
timeout float | None

In seconds. Timeout to wait for page title to change. If None, the global timeout setting is used (default 5 seconds).

None
Example
1
2
3
4
5
6
7
from browserist import Browser

with Browser() as browser:
    browser.open.url("https://example.com")
    baseline_text = browser.get.page_title()
    browser.click.button("//xpath/to/button")
    browser.wait.until.page_title.changes(baseline_text)

contains(page_title_fragment, timeout=None) #

Wait until the page title contains a specified text fragment, e.g. after a redirect or update.

Parameters:

Name Type Description Default
page_title_fragment str

The input can contain both a fragment or the full page title.

required
timeout float | None

In seconds. Timeout to wait for page title to contain text fragment. If None, the global timeout setting is used (default 5 seconds).

None
Example
1
2
3
4
5
from browserist import Browser

with Browser() as browser:
    browser.open.url("https://example.com")
    browser.wait.until.page_title.contains("Example")

equals(page_title, timeout=None) #

Wait until the page title has changed to a specific text, e.g. after a redirect or update.

Parameters:

Name Type Description Default
page_title str

Full page title to compare the new current page title against. Evaluated as an exact match.

required
timeout float | None

In seconds. Timeout to wait for page title to match specified text. If None, the global timeout setting is used (default 5 seconds).

None
Example
1
2
3
4
5
from browserist import Browser

with Browser() as browser:
    browser.open.url("https://example.com")
    browser.wait.until.page_title.equals("Example Domain")