Selenium Fundamentals
3.6 (4 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
13 students enrolled

Selenium Fundamentals

Speed up your testing by automating user interaction with browsers and web applications
3.6 (4 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
13 students enrolled
Created by Packt Publishing
Last updated 12/2018
English
English [Auto]
Current price: $139.99 Original price: $199.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 2.5 hours on-demand video
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Selenium Fundamentals is designed for you if you are a software quality assurance and development professional who wants to learn how to automate browser activity and web-based user interface tests with Selenium.
Course content
Expand all 52 lectures 02:23:38
+ Getting Started
6 lectures 16:51

Let us begin our learning journey on Selenium Fundamentals. In this course, we will cover a broad range of the concepts, benefits, fundamentals, data management techniques and advantages of Selenium.     

Preview 02:09

Before we learn about Selenium, let us learn about software automation and its importance to the development cycle in this video. We will also learn about Selenium WebDriver – the most commonly used automation tool. This lesson has three topics. They are:

  • Software Automation

  • Selenium Overview

  • Environment Configuration

Preview 00:42

The SDLC consists of many tasks and processes. For a very long time, most of these tasks were performed manually. Imagine the time, manpower and resources taken to work on these tasks! Automation turns a manual process or system into a system that operates automatically. Let us learn about the benefits of automation and why it is preferred over manual.   

Preview 01:53

Now that we have known the benefits of automation, let’s take a look at tools used to automate the web browser through the Selenium Server, its benefits, its execution, and the standardized API. We will then learn about the Selenium IDE.   

Selenium Overview
03:28

To get hands on experience on the execution of Selenium web server, let’s configure the browser drivers which we will use to test our code in the later part of the course. Let us also learn about creating a Maven project in this video.   

Environment Configuration
08:05

Let us take a quick recap of all that we have learnt in this lesson through this video.

Lesson Summary
00:34
Test Your Knowledge
5 questions
+ WebDriver Functionality
8 lectures 19:32

In the previous lesson, we learnt about the importance of  automation and its use in testing web applications, browser drivers,  verifying our environment for Selenium and so on. Let us know learn  about WebDriver object in Selenium, the methods used in the WebDriver  class, and navigate between web windows.  

Preview 00:52

To understand the WebDriver functionality, let us first look at  the relationship between WebDriver and the Chromedriver implementation.  This video will help us understand the initiation of a WebDriver in  Chrome.  

Instantiating a WebDriver – Chrome
02:28

Selenium WebDriver is an API that allows to automate the browser  activity. To automate our browser activities, let us first look at the  most frequently used methods of the WebDriver class.  

An Overview of Frequently Used Methods
01:44

A web application starts as a single page in a browser window, but  new windows and popups can be opened and closed throughout the  workflow. The WebDriver class provides methods to handle navigating,  resizing, and switching between windows. Let us learn to navigate  through the webpages using the Selenium script.   

Controlling the Browser Window
02:36

Usually a browser window opens with the default settings.  Depending on our objective, it might be necessary to change the browser  window size. For example, if we have a responsive web application, we  might want to change the browser size to automatically check how the  application behaves in different window sizes. Let us try doing this in  the coming video.  

Resizing
02:55

Web applications include pop-up alerts (modal dialogs) during any  part of the process. Let us learn about the types of alerts with some  examples.  

Managing Alerts
03:52

A web application can include frames that divide pages into  different sections, each sections includes specific content. Let us  learn to manage these frames through the WebDriver class.  

Managing Frames and Windows
04:38

Now, let us take a quick recap of our learnings from this lesson.  We will look at the important points that we covered in this lesson.                       

Lesson Summary
00:27
Test Your Knowledge
4 questions
+ WebElement Functionality
6 lectures 19:48

In the previous lesson, we explored the frequently used methods of  the WebDriver class. We created a WebDriver instance and controlled the  Google Chrome browser momentarily by navigating, switching windows, and  resizing it. Let us now learn to use Chrome's Developer tools, work  with different techniques to locate elements on a page and how to  interact with them.         

Preview 00:45

To interact with the web application, a web browser is required.  We should be able to review and analyze the code behind a web page in  order to understand it and define how to locate and interact with its  elements for testing purposes. This video will help us to inspect a web  page explains steps to instantiate a WebDriver Variable for Chrome.   

Using Browser Developer Tools – Chrome
02:57

The Selenium WebElement interface allows you to create variables  of the WebElement type, which represent HTML elements on a web page. It  also provides methods to interact with these elements. Let us learn  about the frequently used methods in a WebDriver class and how to use  the driver object to navigate to a desired web application URL.   

Overview of WebElement Functionality
04:40

A web application consists of many elements like text box, radio  buttons, check boxes, and so on, that a user can interact with. Let us  learn about some of the methods to be able to interact with these  elements.   

Interacting with Elements on a Page
08:04

In order to interact with the elements, you first have to find  them. In this topic, we'll look at how to find elements on the webpage  in many different ways. Let us learn about the different types of the  element locators in this video.   

Element Locator Types
02:58

Let us take a quick recap of all the important points we learnt about in this lesson.  

Lesson Summary
00:24
Test Your Knowledge
3 questions
+ Advanced Element Location
5 lectures 15:31

We have come almost halfway through the course. In this video, let  us learn to identify web elements in a web application by using  effective element locators.             

Preview 00:47

Elements allow us to interact with a web application just like a  real user would; that is why it is important to understand how to locate  elements and how to choose good locators. Let us learn about the  structure of DOM, relationship between Selenium and DOM and the DOM  elements.             

Navigating the DOM
05:53

Automating web applications primarily involves finding elements in  the DOM. Sometimes, we can't figure out the locator for the element we  need, either because it is missing attributes, or there are simply too  many elements with the same attributes. Let us learn to locate the web  elements.  

Searching Within Previously Found Elements
04:05

Now that we know how important the CSS locators are, let us learn  to use these CSS locators through the Class Attributes and the Elements  ID.  

Creating Complex Locators to Reach Any Element
04:18

In this video, let us summarize our learning from this lesson.                       

Lesson Summary
00:28
Test Your Knowledge
3 questions
+ Waiting for Elements
6 lectures 13:59

Web applications process a lot of data in the background or  asynchronously before showing elements on the page. As a consequence,  web applications do not have a constant speed. Let us learn to manage  the automation script flow through implicit and explicit waits through  this video. We will also learn to write a stable automation script by  waiting for an element to be present.           

Preview 00:58

We have already learned to find elements in the DOM. But what if  one or more elements cannot be found because they have not yet been  loaded on to the page? That's when implicit waits are helpful. Let us  see how they can be implemented in our syntax.   

Implicit Waits
02:16

An implicit wait will wait for every element that is part of our  automation script. However, explicit waits allow us to control the  automation script flow for one or more specific elements, and under  predefined conditions. Let us learn in detail about Explicit Waits in  this video. 

Explicit Waits
02:30

Now that we have learned what implicit and explicit waits are,  let's review how they compare to each other and their advantages over  the other in this video.   

Implicit versus Explicit Waits
01:46

As we already know, explicit waits allow us to build a test using  many pre-conditions that are provided by the ExpectedConditions class.  But what if these conditions are not sufficient to recreate a test  scenario? The good news is that we can implement the ExpectedCondition  interface to create custom wait conditions as needed. Let us learn how! 

Waiting for an Element with a Custom Written Condition
06:01

Let us summarize our learning from this lesson in this video.     

Lesson Summary
00:28
Test Your Knowledge
2 questions
+ Page Object Model
5 lectures 14:47

Now that we know how to use Selenium and a test framework, we can  create hundreds of unstructured tests. The Page Object Model is a  well-known pattern that introduces a middle layer to tests, which can  help to reduce code duplication and make the code easier to understand.  Let's learn about it further in this video.   

Preview 01:08

It is important to know the Web Application structure before we  learn the Page Object Model. By applying software development best  practices, we can separate the navigation and validation tasks for  automation script writing. Let us learn to do this through Page Object  Model.   

Introducing the Page Object Model
05:17

A Page Object is an abstract representation of a web page that  includes its elements and its attributes; where we can perform  automation scripts that follow the POM approach. Let us learn the  modeling of the web application using Page Objects. 

Modeling a Web Application Using Page Objects
05:50

In the previous video, we learned the implementation of Page  Object Model for a web application with one or more web pages. However,  applications sometimes involve more complex structures. In this video,  let us discuss the complexity of web application structures and web page  layouts. 

Implementing Nested Page Object Instances
02:00

Let us summarize our learning of this lesson through this video.                       

Lesson Summary
00:32
Test Your Knowledge
2 questions
+ Writing Tests
6 lectures 12:09

Selenium helps us automate browsers, but we want to do more than  just that, like validate if the web application is working as expected.  To do this, we need to add a test framework in to the mix. In this  video, let learn to us combine Selenium and a test framework, and write  tests to check and assert a web application's elements and behavior.   

Preview 00:54

Let us learn about a test framework and its common features. In  this video, we will also explore various benefits, and how it can make  automated testing easier for the test teams.   

Understanding a Test Framework
02:26

There are many options out there when it comes to test frameworks.  When working with Java, JUnit and TestNG are the most used ones. Let us  learn to pick the most appropriate test framework while working with  Selenium.   

Choosing a Test Framework
02:07

Once we have learnt to compose the test cases using Selenium, we  can automate the test by adding TestNG annotations and setting up the  test through the testng.xml file. In this video, let us learn to perform  these tasks.   

Creating Test Scripts and Suites
04:59

Now that we have learnt to set up our test framework, let us lean to validate and view its results.   

Validating and Viewing Results
01:16

Now let us summarize our learning from this lesson.  

Lesson Summary
00:27
Test Your Knowledge
5 questions
+ Analysis and Troubleshooting
5 lectures 19:52

From novices to experts, every person deals with failures from  time to time. Whether these errors involve flaky tests or indicate major  regressions, automation engineers need to review the failures and  report them accordingly. This lesson will cover the basics of  determining the root cause of a test failure and determining the best  course of action for correcting it.   

Preview 00:43

We all know that no matter how hard we work on the design of our  test, there will always be the chance of encountering faults in either  our testing code or the web application that we are testing. Let us see  how we can identify those errors and find solutions. 

Analyzing a Test Report
05:37

Estimating the execution time of a test is not an easy task.  However, sometimes, we understand that the execution time is longer than  it should be. In this video, we will learn how to track down timing  errors in our tests.   

Tracking Down Timing Errors
08:12

Sometimes, our tests fail intermittently. Not only does it destroy  confidence in your test suite, but it also may mask real errors as  well.  In this video, let us look at some strategies for separating real  issues from flaky tests. 

Separating Real Issues from Flaky Tests
05:03

Let us summarize our learning from this lesson.  

Lesson Summary
00:17
Test Your Knowledge
5 questions
+ Using a Selenium Grid
5 lectures 11:09

In this lesson, let us learn to configure a Selenium Grid on local  machines for testing with multiple browsers. This lesson will also  cover how to connect to popular third-party testing services in the  cloud. 

Preview 00:45

We can run the Selenium Grid on the local machine, allowing us to  test a combination of browsers quickly. Let us learn how to set up a  local Selenium grid and connect it to our scripts.   

Configuring and Connecting to a Local Grid
05:23

A local Selenium Grid has a small downside: it is limited to the  operating system of the local machine and the browsers supported by it,  also the available RAM and CPU on that machine. A solution is to create  Nodes in different machines and add them to our Hub. Let us see how we  can overcome this challenge.   

Configuring and Connecting to a Network Grid
01:48

Some organizations find it restrictive to run a Selenium Grid on  their own network as it may be too computationally intensive or bog down  the network.  Therefore, many companies turn to a Software-As-A-Service  solutions provided by third parties. Let us learn to connect to these  services as they are often just as simple as connecting to local  Selenium Grids. 

Connecting to a Third-Party Service
02:12

Let us summarizes our learning from the course.  

Lesson Summary
01:01
Test Your Knowledge
2 questions
Requirements
  • Should have hand-on knowledge of web-based user interface testing with Selenium.
Description

We’ll begin this course by understanding the importance of automating tests. Then, we will learn how to choose good selectors for navigating through your web application while highlighting best practices and techniques.

After writing your first tests, you will go through the object model to help create your own advanced test cases. You will learn how to analyze a test report, track timing errors, and separate real issues from "flaky" tests. You will also learn how to configure and connect to a local grid, a network grid, and a third-party service. By the end of the course, you will have the skills you need to run automated tests on your own web application.

About the Author

Patrick Viafore has worked in the professional software engineering field since 2007 on multiple projects such as:

  • Server applications running 24/7 in C++

  • Web Tools for internal and external use

  • Embedded telecommunication applications

  • Modularizing code and refactoring in very large code base

  • Continuous Integration / Continuous Delivery pipelines for products

  • Laying groundwork for architecture for next-generation products.

He has a strong focus on code quality, software design, and refactoring.

He demonstrates strong leadership skills by being a project lead/team lead on projects in addition to performing tasks as a Scrum Master and Agile coach.

Patrick has helped organization cross-training by leading "Cleaner Code Workshops", with topics such as unit testing and dependency breaking, as well as organized book clubs for team to help promote knowledge growth.

His professional Speaking Experiences are as follows:

  • Python User Group: 1-hour Talk - Selenium and Automating Testing for the Web

  • Python User Group: Lightning Talk on the Bottle Microframework for Web Applications

  • PyTennessee2017 - 45 minute talk on BDD To The Bone: Using Behave and Selenium to Test-Drive Web Applications

  • HSV.cpp: 15 minute Lambda Expressions in C++

  • His Specialties/Interests include: Software Design, Testing, Software Engineering Best Practices

  • Languages proficient in: C++, Python, JavaScript

  • Languages familiar with: Elixir, Rust, Clojure, C, Ruby, Coffeescript, Java, PHP

  • Languages with limited experience in: Elm, Haskell, Prolog, Io, Erlang, Scala

  • Databases worked with: MongoDB, MySQL, PostgreSQL.

Diego Molina is a software engineer in Test, specialized in testing tool development, advising, and training teams how to test better. He worked initially as a software developer for 8 years before switching completely to testing, where he has been during the last 7 years. He is one of the maintainers of the official Docker-Selenium project and a Selenium contributor.

He also co-created Zalenium, a dynamic, ready to use Selenium Grid. He spends most of his time working with different teams and finding ways to do UI testing in a more simple way. Additionally, he is often attending the Selenium conferences, either presenting or collaborating with the on-site workshops. You can find him often in the IRC/Slack channel for Selenium.

Who this course is for:
  • Get an overview of Selenium
  • Identify what to automate in a project and configure the environment
  • Learn to control browser behavior and manipulate web page elements
  • Understand the nuances of writing tests and creating test suites
  • Create UI tests with Selenium WebDriver and analyze test results
  • Troubleshoot errors in automation and build out meaningful reporting