I teach courses and do trainings for Selenium,Cypress, and Playwright, but Selenium, out of the box, feels clunky. When you start at a new place, you almost always need to "setup" the framework from scratch all over again. Instead of getting right to creating meaningful tests, you end up spending most of your time building a custom framework, maintaining it, and having to teach others to use it.
Also, many people blame Selenium for bad or flaky tests. This usually tells me that they have yet to experience someone that truly knows how to make Selenium amazing! This also tells me that they are not aware of the usual root causes that make Test Automation fail:
Poor programming skills, test design, and practices
Flaky applications
Complex frameworks
What if we tried to get the best from both worlds and combine it with a fantastic language?
Selenium has done an amazing job of providing W3C bindings to many languages, making scaling a breeze. W3C is the standard for the web, so leveraging it just makes sense.
Cypress has done an amazing job of making the testing experience more enjoyable - especially for beginners. It's easy to start with and the API is readable and flows nicely.
Pylenium looks to bring more Cypress-like bindings and techniques to Selenium (like automatic waits) and still leverage Selenium's power along with the ease of use and power of Python.
# Define your setup and teardown fixture
@pytest.fixture
def driver():
driver = webdriver.Chrome()
yield driver
driver.quit()
def test_carlos_is_on_leadership(driver):
wait = WebDriverWait(driver, timeout=10)
driver.get("https://qap.dev")
# Hover About link
about_link = driver.find_element(By.CSS_SELECTOR, "a[href='/about']")
actions = ActionChains(driver)
actions.move_to_element(about_link).perform()
# Click Leadership link in About menu
wait.until(EC.element_visible(By.CSS_SELECTOR, "a[href='/leadership'][class^='Header-nav']")).click()
# Check if 'Carlos Kidman' is on the page
assert wait.until(lambda _: driver.find_element(By.XPATH, "//*[contains(text(), 'Carlos Kidman')]"))