Overview

Pylenium offers many commands and features out of the box.

py

This is the main object in Pylenium. This is essentially the Bot or Browser you're controlling in your tests. Navigate to websites, take screenshots, find elements to click on or enter text, and much more!

example
from pylenium.driver import Pylenium


def test_visit(py: Pylenium):
    py.visit("https://qap.dev")

Element and Elements

These commands allow you to interact and perform actions against an Element or Elements.

Chain commands
py.get("ul").find("li").first().click()
or use variables
# Click the first element with id=button
element = py.get("#button")
element.click()
Mix and match variables and chains
# Print the href value of all links on the page
elements = py.find("a")
for el in elements:
    print(el.get_attribute("href"))
Use what is best for you :)
# Check all checkboxes
py.find("input.checkbox").check()

Last updated