text

The command to get the text of the current Element.

Syntax

Element.text() -> str

Usage

correct usage
assert py.get(".nav.link").text() == "About"

---or---

assert py.get(".nav.link").should().have_text("About")
incorrect usage
# Errors, 'text' is not a property
py.get("a").text

Arguments

  • None

Yields

  • str - The text of the current Element

Last updated