Elegant Browser Automation with Python and Selenium
Master the fundamentals of browser automation using the Python language with Selenium. Walk confidently into any interview for entry-level browser automation or increase your technical value by showing your current employer that you are ready for new and bigger challenges.
Learn lessons collected over years of professional automation in just a few hours.
- Fast, readable automation using minimal code
- The quickest and most effective way to identify web elements
- Page Objects and Element Objects implemented sensibly and effectively
- Industry-ready test structure and composition
A Bulletproof approach to automation fundamentals
Python is one of the most popular languages in the world, and the demand for it is only increasing. Selenium is an industry standard for test automation, so Python’s readability make the two a perfect match for writing valuable automated tests.
Browser automation is in high demand as software testing costs rise and the software industry explodes in size. Unfortunately, engineers interested in automation have little in the way of concrete guidance on how to be successful, or what properly written automation code even looks like.
The most widely circulated videos on these topics speak only to the technologies themselves, and do not offer viable implementation guidance or valuable industry practices. I have made these valuable practices the focus of this course.
Content and Overview Suitable for those comfortable with basic Python and Object-Oriented Programming concepts, these lectures build a rock-solid foundation of skills required to automate at a professional level.
Beginning with a step-by-step setup of the development environment using Virtual Environments (a must for aspiring Python developers) and Selenium setup, this course allows you to watch as I walk you through each step, explaining as we go.
Once the environment is ready we will discuss how web elements work, and how the best and fastest automation engineers (a rare breed!) identify them for automation. I will demonstrate each concept in real time as a conversation. That means you will spend almost NO time watching traditional lectures or slides, and almost all your time seeing the concepts in action or following along with me.
Students completing the course will have the knowledge to begin a career in entry-level browser automated testing, or to automate their browser for any number of useful purposes to include data-scraping and task automation.
Equipped with code samples,code challenges, short quizzes, and info-rich videos, you’ll have no trouble following along with the concepts, and I am always available for questions.
Finally, automating is a blast, and I wish more people did it. Let me rephrase that – I wish more people did it, and did it well! We need more people like you executing effective, high-value automation solutions, so let’s get started on this journey together!
Setting Up Your Environment
We will be using Python 3.6 for this course - setting up a virtual environment will ensure you don't go through the frustration of problems caused by environmental differences
A short quiz covering the concept of the Python virtual environment.
Before we dive in, let's have a quick discussion about Selenium, browsers, and how the two communicate.
I will walk you through setting up Selenium and ChromeDriver. Next step, your first automation!
For Mac users, adding the location of your webdriver to the PATH environment variable is slightly different than the process on a Windows machine. Follow along as we ensure our machine is set up to use Selenium effectively.
A short quiz covering the setup of the selenium library with python
Browser Automation Basics
Enough setup, let's automate! We use Python and Selenium (with chromedriver) to open up a Chrome browser and perform a google search.
In order to manipulate elements, we must be able to find them. In this hands-on tutorial we practice finding a variety of elements in the DOM.
What is a webdriver? What are its basic functions? We explore this crucial tool in a short quiz.
It's time to put your new skills to the test! I have created three short challenges for you to overcome using Python and Selenium.
Batman has an awesome utility belt. You should too. We also answer common questions like, "Why is it almost never good to use time.sleep()?" and "What happens if an alert pops up during the automation?"
Learn how to manipulate multiple browser windows at the same time and switch between browser tabs.
Professional Browser Automation
What are Page Objects, and why should we use them? We discuss when they are useful, and when they are harmful.
Let's start with the most common implementation of Page Objects, using functions for each action taken on a web page. This is not the most elegant approach, but it is one of the most common in the industry, and useful for an introduction to the idea of Page Objects. The benefits of upgrading to Base Elements and Base Pages will become apparent very quickly.
Today you learn the secrets of writing fast, non-brittle, readable automation by using Base Elements, Explicit Waits, and properties. This may be the most important lecture in this course, because it is the knowledge that will set you apart from most of the industry.
Let's wrap up all of the basic browser automation concepts into an elegant script that proves just how fast it can be to write robust, readable automation scripts!
Let's improve our locators so they are more useful, readable, and waste less code.
As if automation weren't fun enough already, it turns out there are a lot of people who want to pay you to do it. If you're looking to get into automation as a profession, you need to display a solid foundation of browser automation principles. Let's review what we've covered so far.