Contribute Media
A thank you to everyone who makes this possible: Read More

Beyond Unit Tests End to End Web UI Testing – Andrew Knight (PyCon Taiwan 2021)


Day 1, 11:35-12:05


Unit tests are great, but they don’t catch all bugs because they don’t test features like a user. However, Web UI tests are complicated and notoriously unreliable. So, how can we write tests well? Never fear! Let’s learn how to write robust, scalable Web UI tests using Python, pytest, and Selenium WebDriver that cover the full stack for any Web app. In this talk, we will write one simple test together that covers DuckDuckGo searching. You’ll learn how to write battle-hardened Web UI tests for any Web app, including Django and Flask apps. I’ll also provide plenty of hands-on tutorials and resources to continue learning after this talk.


Web UI testing is difficult because many folks don't know how to do it, or they aren't experienced in how to handle fine details like locators or race conditions. In this talk, you will learn how to automate tests in Python using pytest and Selenium WebDriver. We will cover:

Using Selenium WebDriver like a pro Modeling Web UI interactions with page objects Writing “good” feature tests that are efficient, robust, and readable Deciding what should and should not be tested with automation Considering Playwright as a Selenium alternative The example code is here:

I also developed courses for Test Automation University on this topic:

Slides not uploaded by the speaker. HackMD:

Speaker: Andrew Knight

Pandy Knight is the “Automation Panda” - an engineer, consultant, and international speaker who builds solutions for software testing problems. He has designed and built robust test automation projects for web apps, service APIs, and operating systems with thousands of tests running continuously. He is the lead developer for Boa Constrictor, the .NET Screenplay Pattern. He also mentors others in good development, testing, and BDD practices. Andy currently works full-time as the Lead Software Engineer in Test for PrecisionLender at Q2. Read his tech blog at, and follow him on Twitter at @AutomationPanda.


Improve this page