Elegant Browser Automation With Python And Selenium

Fast, scalable, professional-grade UI automation principles

Last updated 2022-01-10 | 4.6

- Automate professionally
- build applications that scrape web data
- Build sustainable
- scalable
- readable UI automation

What you'll learn

Automate professionally
build applications that scrape web data
Build sustainable
scalable
readable UI automation

* Requirements

* You should have a basic grasp of the Python programming language.

Description

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!

Who this course is for:

  • Anyone interested in automating professionally (and effectively), or who is interested in web scraping

Course content

4 sections • 25 lectures

Setting up Python 3 (Windows) Preview 10:31

Let's get python downloaded and installed, so we can minimize the possibility of errors and other frustration.

Setting up Your Virtual Environment (Windows) Preview 13:33

In order to avoid errors and make this course as smooth as possible, we need to set up a virtual environment for you to run your automation in. It's also a skill you'll need as a professional automator!

Setting up Python 3 and the Virtual Environment (Mac OS / Linux) Preview 15:15

Don't worry Mac OS and Linux users, I've got you covered! We'll install Python 3.8 and set up your virtual environment to make sure your experience is smooth and error-free!

Python Virtual Environments

A short quiz covering the concept of the Python virtual environment.

What is Selenium? Preview 06:31

Before we dive in, let's have a quick discussion about Selenium, browsers, and how the two communicate.

Setting up Selenium Preview 18:23

I will walk you through setting up Selenium and ChromeDriver. Next step, your first automation!

(MAC/LINUX ONLY): Adding a webdriver to your PATH environment variable Preview 16:57

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.

Setting up Selenium

A short quiz covering the setup of the selenium library with python

Your First Automation Preview 28:56

Enough setup, let's automate! We use Python and Selenium (with chromedriver) to open up a Chrome browser and perform a google search.

Finding Elements on the Page Preview 45:32

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.

The Webdriver

What is a webdriver? What are its basic functions? We explore this crucial tool in a short quiz.

Skills Challenge Preview 37:07

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.

Your Selenium Utility Belt Preview 33:08

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?"

Handling Browser Windows and Tabs Preview 14:00

Learn how to manipulate multiple browser windows at the same time and switch between browser tabs.

Handling IFrames and Frames Preview 16:28

Why can't I find elements that are in an iframe? Let's learn how to use webdriver.switch_to.frame() and webdriver.switch_to.default_content() to do just that!

Why Page Objects? Preview 21:03

What are Page Objects, and why should we use them? We discuss when they are useful, and when they are harmful.

Creating Page Objects Preview 26:55

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.

Creating Page Objects (cont.) Preview 36:50

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. 

Page Objects

It's important to have a strong foundation on how Page Objects and Elements function in a healthy, readable testing framework.

Elegant Browser Automation Preview 28:40

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!

Better Locators Preview 14:40

Let's improve our locators so they are more useful, readable, and waste less code.

The Secret Sauce Pt. 1 Preview 17:53

How can we analyze listings like Amazon or Ebay? How can we solve the Two Merchants problem from the Skills Trial more efficiently? We answer both of these questions as we explore Element Trees, and why they are faster and more efficient than calls to the browser.

The Secret Sauce Pt. 2 Preview 15:26

In this lecture we learn how to use classes to take advantage of the flexibility of Element Trees.

The Interview

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.