Skip to main content
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.

Every example runs in CI, every night

  • Selenium · PythonLast CI run of the Selenium · Python examples (opens in a new tab)
  • Selenium · JavaLast CI run of the Selenium · Java examples (opens in a new tab)
  • Selenium · C#Last CI run of the Selenium · C# examples (opens in a new tab)
  • Selenium · JavaScriptLast CI run of the Selenium · JavaScript examples (opens in a new tab)
  • Selenium · RubyLast CI run of the Selenium · Ruby examples (opens in a new tab)
  • Selenide · JavaLast CI run of the Selenide · Java examples (opens in a new tab)
  • Playwright · TypeScriptLast CI run of the Playwright · TypeScript examples (opens in a new tab)
  • Playwright · PythonLast CI run of the Playwright · Python examples (opens in a new tab)
  • Playwright · C#Last CI run of the Playwright · C# examples (opens in a new tab)
  • Playwright · JavaLast CI run of the Playwright · Java examples (opens in a new tab)
  • WebdriverIO · TypeScriptLast CI run of the WebdriverIO · TypeScript examples (opens in a new tab)
  • Vibium · JavaScriptLast CI run of the Vibium · JavaScript examples (opens in a new tab)
  • Vibium · PythonLast CI run of the Vibium · Python examples (opens in a new tab)
  • Vibium · JavaLast CI run of the Vibium · Java examples (opens in a new tab)
  • Appium · Sauce Labscoming soon
  • Mobilewright · Sauce Labscoming soon
  • Espresso · Sauce Labscoming soon
  • XCUITest · Sauce Labscoming soon
Frameworks

Pick your tool

Selenium is where we started. Selenide, Playwright, WebdriverIO and Vibium are here too, and mobile frameworks are on the way.

Mobile will run on real devices in Sauce Labs

AppiumAndroid and iOSSauce LabsComing soon
MobilewrightAndroid and iOSSauce LabsComing soon
EspressoAndroid, KotlinSauce LabsComing soon
XCUITestiOS, SwiftSauce LabsComing soon
Missing your framework?Tell us in GitHub DiscussionsSuggest one
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
  • Pick your language inside each tool
Read tip 1 →
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
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

Mobile tips need devices and emulators, so they will run 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.

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.

Read the contributing guide →