Free and open source
Short, tested tips for web and mobile test automation
Each tip shows how to automate one use case, like uploading a file or handling an alert. The code is real, and CI runs every example.
Selenium is where we started. Selenide, Playwright, WebdriverIO and Vibium are here too, and the mobile tips run on real Android and iOS devices.
Web
Runs in CI on Linux, Windows and macOS
Mobile
Runs in CI on real devices in Sauce Labs
One use case, many tools
How To Upload a File
- Every tip solves one use case. Switch the tool to compare how each framework does it.
- Same use case, same test site
- Each example is a full project you can run
- Selenium
- Selenide
- Playwright
- WebdriverIO
- Vibium
- Python
- C#
- Java
- JavaScript
- Ruby
1-upload-a-file/code/python/upload.py
import os
import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
@pytest.fixture
def driver_setup_teardown():
driver = webdriver.Firefox()
yield driver
driver.quit()
def test_file_upload(driver_setup_teardown):
driver = driver_setup_teardown
filename = 'some-file.txt'
file = os.path.join(os.getcwd(), filename)
driver.get('https://the-internet.herokuapp.com/upload')
driver.find_element(By.ID, 'file-upload').send_keys(file)
driver.find_element(By.ID, 'file-submit').click()
uploaded_file = driver.find_element(By.ID, 'uploaded-files').text
assert uploaded_file == filename, "uploaded file should be %s" % filename
Start here
Why trust the code
Tested, not just written
Runs every night
CI runs the web examples on three operating systems. A broken example fails the build.
UbuntuWindowsmacOS
Real devices for mobile
CI runs the mobile examples on real Android and iOS devices in Sauce Labs. You can run them with a free account.
Short and focused
One use case per tip, with a walkthrough of every important line. Read it in five minutes.
Get involved
Know a better way?
Write a tip, add your language or framework to an existing one, or fix an example. We review every pull request.