Selenium 2 WebDriver Basics With Java

Learn to automate web applications using Selenium WebDriver with Java.

Video Error

We tried several times to play your video but there was an unforeseen error. We have notified our engineers.

Visit https://helpx.adobe.com/flash-player.html to check that Flash is enabled on your browser.

With Flash enabled, please try again in a few minutes or contact support.

  • Lectures 264
  • Video 23 Hours
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

Course Description

Selenium WebDriver is the web automation tool of the moment. Selenium WebDriver skills are in demand. And when you understand the Selenium WebDriver usage patterns that this course teaches, then you can increase your automation effectiveness.

What are the requirements?

  • Windows PC, although instructions should work on Linux or Mac
  • Open source and free tools: IntelliJ IDE, Java SDK, Firefox, Chrome

What am I going to get from this course?

  • Over 264 lectures and 23 hours of content!
  • By the end of this course you will have a working knowledge of the main parts of the WebDriver API
  • You will know how to create effective synchronisation routines to minimise intermittency
  • You will know how to investigate the functionality of WebDriver by looking in the WebDriver code
  • You will know how to craft effective assertions using JUnit and Hamcrest
  • You will understand how to run your tests on different browsers
  • You will know how to use the Selenium Grid
  • You will know how to use JavaScript with your tests
  • You will understand different locator strategies and know how to use both CSS selectors and XPath selectors
  • You will learn productivity techniques and approaches using the IntelliJ IDE

What is the target audience?

  • Testers with some experience of programming
  • Programmers who want to learn browser automation
  • Selenium RC users who want to learn WebDriver

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Introduction
05:23
An overview of the course.
About the Instructor: Alan Richardson
Preview
04:27
00:52
Welcome to the course, a personal message from Alan Richardson - your instructor
01:43
Aims are simple. Get you using Java and WebDriver and understand how to automate most of the web and html controls that you will encounter in your automation tasks.
04:23

This section is not mandatory. I feel obliged to add a small section on the history of Selenium and WebDriver because every other trainer will, but I do not want to spend a lot of time on the history, because I want to get you coding.

Section 2: Getting Started
06:44

This video is a slide based introduction to the tools we will use and an overview of how we will install them. We will cover: Java SDK, Maven, IntelliJ, Firefox, Firebug, FirePath

Section 3: Getting Started - Install on Windows
08:03

This video shows how to install the Java JDK 1.8 on Windows 10. We need to install the JDK and not the JRE so we check by seeing if 'javac' is installed.

03:56

This video shows how to install the Java JDK 1.8 on Windows 10. We need to install the JDK and not the JRE so we check by seeing if 'javac' is installed.

01:26

This video shows how to install Firefox so that we can use it with Selenium Webdriver.

04:10

This video shows how to download a test project from Github, update it to the current version of Selenium WebDriver and run the test from the command line. This checks that maven is operating properly.

02:18

This video shows how to install IntelliJ Community Edition.

03:30

This video shows how to open the github project and run the test from IntelliJ. This checks that IntelliJ works correctly with the Java and Maven install.

Section 4: Getting Started - Install on Mac
04:03

The Mac setup seems quite straightforward.

I installed the Java JDK by following the instructions on the oracle site.

http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html

I installed maven by following the instructions directly on the maven.apache.org site for Mac. And the video on this lecture shows how I did that.

I installed IntelliJ for Mac from the JetBrains site.

I was able to import the projects into IntelliJ and create tests and pom.xml as demonstrated in the Windows lectures. I didn't really find many differences in the installation from Windows to Mac.

03:57

To make the exports 'persist' on a mac we have to add them to our bash_profile in our $HOME directory.

You can find the instructions I followed on StackOverflow, or watch the video

http://stackoverflow.com/questions/21028872

Section 5: Getting Started - Final Points
04:06

Install firebug and firepath, with reasons why you should and a quick demo of each

Firefox http://www.getfirefox.net/

Firebug https://addons.mozilla.org/en-US/firefox/addon/firebug/

FirePath https://addons.mozilla.org/en-US/firefox/addon/firepath/

FireCookie no longer required as the functionality is now part of firebug

Section 6: Logistics and Access to Course Materials
Text

The supplementary material for this lecture contains the source code for this course. Download the zip file from the materials tab after starting the lecture. Unzip the file and you can import the source code into IntelliJ following the next lecture.

 readme.txt notes for the updates are in the attached .txt files 
247 pages

The slides for the course for offline study.

7 pages

A set of summary slides and tables that you can use to help remind you of the API usages as you work with WebDriver. Print these out for a handy small reference.

00:55

The source is also available in a subversion repository. You do not NEED access to the subversion repository until later in the course when we start discussing continuous integration. The source code in the zip file that you can download, is exactly the same as the subversion repository. And when I check in code to the repository, I also update the zip file in the course.

03:14

When using other people's source code you might discover that you receive an error like.

"java: strings in switch are not supported in -source 1.6

(use -source 7 or higher to enable strings in switch)"

Or something similar.

This video shows you the steps I take to avoid it by adding code in the pom.xml file and the checks I make in the IntelliJ IDE to make sure my configuration is correct.

The compiler settings:

File \ Settings \ Compiler \ Java Compiler

The Project and module settings:

File \ Project Structure | Project Settings \ Project

File \ Project Structure | Project Settings \ Modules

Section 7: Create a Project
01:50

Basic description of maven, what it does, what we will use it for, and where to find more information on maven.

07:31

In this video I show the easy way to create a project. This is how I normally do it, rather than using Maven from the command line.

01:46

In this video I show how to amend the pom.xml in IntelliJ to add Selenium WebDriver dependency, and also how to find the updated version number and update the version of the Selenium WebDriver dependency.

01:26

A short summary of why we use maven on this course.

17 pages

Tips for working with Maven. If you experience problems getting started with maven then this slidedeck might help.

07:31
General troubleshooting steps for maven. Deleting from the local repo, using "mvn clean compile -DskipTests=true" and a variety of other methods explored.
04:47
How to configure maven to use a proxy. Demonstration of what a download error in the maven output looks like. What happens after a download error, and some steps to fix them.
Section 8: Opening and Importing Maven Projects with IntelliJ
02:06

In this video I explain IntelliJ folder structure, describe the folders we add to version control, and show how to delete the IntelliJ files to reset your directory back to a plain maven project.

02:48

You will generally use the most up to date versions of IntelliJ. This shows how to import the initial pom you created using the import wizard of IntelliJ 15. Using import allows you to setup the configuration during the import process, rather than as you work with the project.

02:13

You will generally use the most up to date versions of IntelliJ. This shows how to import the initial pom you created using the open wizard of IntelliJ 15. Using Open allows you to setup the configuration after the import process as you work with the project. This is useful when you have more experience and a more fully detailed pom.xml file.

Section 9: Create A Project, the hard way, with Maven command line
00:40

This is a set of older videos showing how to create a maven project from the command line, then import the project into IntelliJ and edit it to remove the generated JUnit code and import Selenium WebDriver.

Feel free to skip this section, but I've left it in case you ever want to create a maven project from the command line. Which I've never needed to do, and don't recommend.

03:54

Use maven from the command line to create a simple maven project, with a brief explanation of the pom.xml file.

01:23

We go off to junit.org to find the most up to date version and amend the pom file.

02:21

Amend the test code automatically generated by Maven

03:08

Amend the pom file to include Selenium as a dependency by going off to SeleniumHQ.org and seeing what version has been released.

Section 10: Begin Coding
04:51

Use HtmlUnit driver to visit http://www.compendiumdev.co.uk/selenium and assert that the title starts with "Selenium Simplified"

04:41

A little about the WebDriver interface, basic commands on driver and the basics of HtmlUnitDriver

02:30

Learn your IDE, "Get a feel for that"

  • Configure for autoscroll
  • Experiment with command completion
  • Learn to view JavaDoc
Own and experiment with the code

03:19

Have the test run in Firefox, and changes required to make that happen.

Section 11: Basic Automation Knowledge
02:09
What is the basic knowledge you need to automated the web?
05:37
Chunking strategy for WebDriver knowledge: Navigate, Interrogate, Manipulate, Synchronise
Section 12: JUnit
13:51
Brief introduction to junit with an example test fully explained
03:46
A basic overview of how maven finds and downloads the dependencies into a local repository
03:44
Demonstrate that 'test' needs to be in the class name for maven to automatically run it when doing "mvn test"
01:47
A brief description of @Before, @After, @BeforeClass, @AfterClass and other JUnit annotations
04:12
A brief look through the JUnit source code
10:26
Using @Before, @BeforeClass, @After and @AfterClass in tests
02:07
A short introduction explaining the JUnit exercises that you should do to reinforce your learning. The exercises will take about 30 mins to do. In the next lecture I will explain the sample answers, but you will get most benefit if you do the exercise before watching the answers.
Sample JUnit Answers Explained
12:15
05:10

How to use the full version of hamcrest with JUnit and Maven. A short discussion of the problem, then demonstration of how to use Hamcrest 1.1 and 1.3 with JUnit 4.10

3 pages

JUnit 4.11 makes it easier to include the Hamcrest matchers in your project. This slidedeck explains how.

Section 13: Navigation
03:22
An overview of the basic navigation commands at the driver level.
03:48
Explain the Driver class, and difference between the sample code and the slide code.  Learn about JVM shutdown hooks
01:59
The navigation exercise will take about 15 - 20 minutes
04:46
A walk through of sample answers to the navigation exercises. The refresh exercise required some basic string parsing and we explain this in the video.
02:53
Does navigation require synchronisation? And what about clicking why is that not navigation?
Section 14: IntelliJ Hints And Tips
02:43

Some useful setup for the project pane in intellij.

Project window settings

 AutoScroll to source/from source

     flatten classes

     show members

02:34

An example of short cut keys that can help with Intellij code navigation

navigation short cut keys:

  •   Shift + Cntrl + Alt + N = find symbol
  •   Shift + Ctnrl + N = find file
  •   Cntrl + N = find class

Section 15: Interrogation
01:11
A brief introduction to interrogation. 
We can do Interrogation at the driver level and the DOM level. To interrogat at the DOM we have to locate before we interrogate.
Driver level Interrogation exercise
01:20
10:30
An example test answer shown, and refactored to use assertThat and @BeforeClass & @AfterClass - reasons for doing the refactoring are also explained.
12:15
An overview of DOM interrogation. How to locate with findElement and the initial set of By locators
01:37
Throw you in at the deep end with an exercise using findElement and By. This should take about 20 minutes or so.
07:29
An overview of the sample answers for first findElement and By exercise.
02:13
An overview of the findElements method.
01:18
Explanation of the exercise to test your understanding of the findElements method. The exercise should take 10 to 15 minutes to complete
05:34
An overview of find elements sample, with a preview of xpath usage and demo of findElements which does not match.
09:35
Examples of chaining findElement and using the ByChained helper class. Also learn about the ByIdOrName helper class. Drop into the code for ByChained and ByIdOrName and remember you can use these as examples when you want to create your own custom By objects.
Section 16: CSS Selectors
17:59
An overview of CSS selectors, and the By.cssSelector location method. CSS selectors are explained using FirePath in firebug.
01:51
Create some tests using By.id etc. and convert them to use By.cssSelector
CSS Selectors Exercise - sample answers
06:26
05:53
Covering popular path selection methods for CSS, parent > child, ancestor descendant, sibling + sibling, and :first-child
Text
The list of CSS references from the slides, with a short description of each link.
Section 17: XPath Selectors
08:22
An over view of XPath selectors, online references, and examples of using them in Firebug and JUnit.
00:37
This should take about 5 minutes, create some tests using By.id etc. then convert to By.xpath
03:51
Sample answers for the XPath exercise
02:21
An additional pdf resource to help with CSS and XPath http://bit.ly/RDJ3Wb
Section 18: Manipulation
01:51

An overview of the basic WebElement manipulation commands, click, clear, sendKeys and submit

11:20

An example of what might happen if you try to automate without some additional knowledge. Includes an example of how to inspect the page and construct tests using firebug.

05:07

An overview of WebDriverWait and the ExpectedConditions helper class

Section 19: Manipulation - Exercises
02:27

An introduction to the manipulation exercises, with an overview of the page that we will be testing and the tasks in the exercise to perform. Also an overview of a sample manipulation test.

Instructor Biography

Alan Richardson, I test stuff, and help people test better.

Alan is the Author of the book "Selenium Simplified" and the book "Java For Testers". He has talked at conferences the world over, and has been involved in testing for almost 20 years.

In November at Eurostar 2012 Alan co-presented (with Simon Stewart) the "Selenium Clinic" tutorial. They won the award for Best Tutorial.

Alan writes on the following blogs and web sites:

Join the biggest student community

14,000,000

Hours of video content

42,000,000

Course Enrollments

10,000,000

Students

Reviews

Average Rating
4.9
Details
  1. 5 Stars
    70
  2. 4 Stars
    3
  3. 3 Stars
    0
  4. 2 Stars
    0
  5. 1 Star
    2
    • Girisankar Kannan

    Best Selenium Course

    • Lyle Hodgson

    One of the most helpful and informative courses I've ever taken

    • James Runde

    You need to take this course

    If you want to learn Selenium WebDriver with Java, then you need to take this course. It's one the best courses on Udemy.

    • François Grossin

    Very useful !

    Everything

    • Grzegorz Zielonka

    Best Video Tutorial Ever Seen and Learned - 5 stars

Show more reviews
Ready to start learning?
Preview This Course