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!
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.
py.get("ul").find("li").first().click()
# Click the first element with id=button
element = py.get("#button")
element.click()
# Print the href value of all links on the page
elements = py.find("a")
for el in elements:
print(el.get_attribute("href"))
# Check all checkboxes
py.find("input.checkbox").check()
Last updated