length

The command to get the length of Elements.

Syntax

Elements.length() -> int

Usage

correct usage
assert py.find("li").length() == 5

---or---

assert py.find("li").should().have_length(5)
incorrect usage
# Errors, 'get' yields Element, not Elements
assert py.get("li").length() == 1

Arguments

  • None

Yields

  • int - The length of the Elements

Last updated