You can learn anything on Udemy. Start today with one of our 10,000+ online courses

Selenium 2 WebDriver Basics With Java

Learn to automate web applications using Selenium WebDriver with Java.
55 reviews
WHAT'S INSIDE
  • Lifetime access to 234 lectures
  • 21+ hours of high quality content
  • A community of 800+ students learning together!
  • 400+ discussions
TAUGHT BY
SHARE

Selenium 2 WebDriver Basics With Java

Learn to automate web applications using Selenium WebDriver with Java.
55 reviews

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.

    • Windows PC, although instructions should work on Linux or Mac
    • Open source and free tools: IntelliJ IDE, Java SDK, Firefox, Chrome
    • Over 234 lectures and 21 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
    • Testers with some experience of programming
    • Programmers who want to learn browser automation
    • Selenium RC users who want to learn WebDriver

CURRICULUM

  • SECTION 1:
    Introduction
  • 1
    Promo Overview Video
    05:23
    An overview of the course.
  • 2
    About the Instructor: Alan Richardson
    04:27
  • 3
    Welcome Message
    00:52
    Welcome to the course, a personal message from Alan Richardson - your instructor
  • 4
    Aims of this course
    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.
  • 5
    Overview Of Selenium
    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
  • 6
    Logistics for tool installs
    02:07

    A description of the installation of the tools. either follow the lectures that follow my free course

    http://www.seleniumsimplified.com/get-started

  • 7
    Install Firefox Browser
    04:25
    Install Firefox browser and briefly mention Saucelabs as a grid provider
  • 8
    Install Firefox Plugins
    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

  • 9
    Optionally Install Console 2
    02:08
    Install Console2 an open source wrapper around command lines e.g. Cygwin or DOS to make later command line based development work easier 

  • 10
    Install Java SDK
    06:19
    How to find and install the Java SDK
  • 11
    Install Maven 2014 Edition - no extra tools
    13:29

    A video showing the installation of Maven. I don't use any extra tools such as Rapid Environment Editor and I show you a common issue that you might encounter when installing Maven, I also explain the thought processes around fixing it.

  • 12
    Optionally Install Rapid Environment Editor
    01:10

    This is completely optional. You do not have to use this tool. Some people prefer to use the windows properties directly, as shown in the previous video.

    Install the Rapid Environment Editor to make it easier to amend Windows Properties

    http://www.rapidee.com

  • 13
    Install Maven 2013 Edition - using Rapid Environment Editor
    08:34

    This is an older version of the "Maven 2014" video showing how to install the tool using console and rapidee to help. If you have already done the "Install Maven 2014" video then you do not need to do this. Install Maven, a build and dependency management tool

  • 14
    Install and Create new Project Using IntelliJ 13
    10:28

    How to install IntelliJ 13 and create your first test quickly. We expand on this in future videos.

  • 15
    Install IntelliJ 12 - (Old version)
    02:22

    Install IntelliJ Free community edition. I have left this as an older version of the IntelliJ install - most people will want to use the new IntelliJ 13 version now.

  • 16
    Get Setup on the Mac - maven
    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.

  • 17
    How to make the Maven exports Persist on a 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 3:
    Logistics and Access to Course Materials
  • 18
    Welcome to Udemy Message
    01:03
    Welcome to the course on Udemy
  • 19
    Udemy Logistics - How to ask a Question
    02:00

    The Udemy interface can lead to mistakes when asking a question or an answer. I want you to be able to contribute to the course and ask questions so in this video I'll show you how the Udemy interface works for questioning.

  • 20
    Udemy Logistics - How to contact your instructor
    01:29

    How to contact your instructor via Udemy messaging? Udemy haven't made the process of messaging your instructor particularly easy. So I'm going to show you how to do it. The short version is visit the following link and message me: https://www.udemy.com/u/alanrichardson

  • 21
    Source Code for Examples
    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.

  • 22
    Import Course Source Code Using Intellij 13
    04:23

    Shows how to import the Course source code from a zip file using IntelliJ 13

  • 23
    Import source code into IntelliJ 12
    02:22
    Demonstration of importing the course source code into IntelliJ 12
  • 24
    Course Slides - download these
    233 pages

    The slides for the course for offline study. These do not seem to render well in the Udemy viewer, best to download these. They do not currently seem to render using Chrome in the Udemy viewer. They do work in Firefox, and you can download the pdf from the "Extras" tab. Update 11/10/2013 I tried again today and it seems that Udemy site has changed again. I could not get it working in Chrome unitl I right clicked and "save as..." but was able to download it in Firefox. Firefox said "This pdf might not display correctly" [Open With Different Viewer], or click the download link in the top right of the embedded pdf viewer.
  • 25
    Selenium Webdriver Java API Summary Cheatsheets
    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.

  • 26
    How to get access to the svn repository
    Text
  • 27
    How to request access to the SVN repository video instructions
    03:15

    A quick overview of how to use the Udemy messaging to request access to the svn repository, and setup an account on xp-dev.

    Some people prefer to take the source code from the svn repository. This is exactly the same code as found as a zip file in the earlier lecture.

    You can skip this section until later in the course if you want. You don't really need to do this until you reach the lectures on continuous integration later in the course.

  • 28
    Install an SVN client
    04:10
  • 29
    Checkout the svn project
    02:05
  • 30
    Create an IntelliJ Project
    06:47
  • 31
    Svn Update and Svn Export
    04:37
  • 32
    How to Fix Java Language Level Errors
    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 4:
    Create a Project
  • 33
    Intro To Maven
    01:50

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

  • 34
    Create A Project Maven
    03:54

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

  • 35
    Import Pom Into Ide
    02:06

    Import the automatically generated pom into an IDE

  • 36
    Update Junit
    01:23

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

  • 37
    Amend Generated Junit
    02:21

    Amend the test code automatically generated by Maven

  • 38
    Add Selenium As A Dependency
    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.

  • 39
    Summary Of Why Maven
    01:26

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

  • 40
    Maven Troubleshooting, Tips and FAQs
    17 pages

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

  • 41
    Maven Troubleshooting Downloads
    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.
  • 42
    Maven Troubleshooting Proxies and Download Cache Issues
    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 5:
    Begin Coding
  • 43
    My First WebDriver Test
    04:51

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

  • 44
    My First Test Explored
    04:41

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

  • 45
    Exercise My First Test
    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

  • 46
    Use A Real Browser
    03:19

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

  • SECTION 6:
    Basic Automation Knowledge
  • 47
    Basic Knowledge Intro and Exercise
    02:09
    What is the basic knowledge you need to automated the web?
  • 48
    Basic Knowledge Answered
    05:37
    Chunking strategy for WebDriver knowledge: Navigate, Interrogate, Manipulate, Synchronise
  • SECTION 7:
    JUnit
  • 49
    JUnit Intro and Example Explained
    13:51
    Brief introduction to junit with an example test fully explained
  • 50
    How is maven getting the dependencies?
    03:46
    A basic overview of how maven finds and downloads the dependencies into a local repository
  • 51
    Run maven with no 'test' in the class name
    03:44
    Demonstrate that 'test' needs to be in the class name for maven to automatically run it when doing "mvn test"
  • 52
    More JUnit Theory
    01:47
    A brief description of @Before, @After, @BeforeClass, @AfterClass and other JUnit annotations
  • 53
    A Quick Look at JUnit's source code
    04:12
    A brief look through the JUnit source code
  • 54
    Example use of @Before, @BeforeClass, @After and @AfterClass
    10:26
    Using @Before, @BeforeClass, @After and @AfterClass in tests
  • 55
    JUnit Exercises Introduction
    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.
  • 56
    Sample JUnit Answers Explained
    12:15
  • 57
    A little more Hamcrest
    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

  • 58
    Notes on Using JUnit 4.11 with Hamcrest
    3 pages

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

  • SECTION 8:
    Navigation
  • 59
    Navigation Introduction - the basic navigation commands
    03:22
    An overview of the basic navigation commands at the driver level.
  • 60
    Explain the Driver class
    03:48
    Explain the Driver class, and difference between the sample code and the slide code.  Learn about JVM shutdown hooks
  • 61
    Navigation Exercises
    01:59
    The navigation exercise will take about 15 - 20 minutes
  • 62
    Navigation Exercises Explained - Sample Answers
    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.
  • 63
    Navigation Discussion
    02:53
    Does navigation require synchronisation? And what about clicking why is that not navigation?
  • SECTION 9:
    IntelliJ Hints And Tips
  • 64
    IntelliJ project pane tips
    02:43

    Some useful setup for the project pane in intellij.

    Project window settings

     AutoScroll to source/from source

         flatten classes

         show members

  • 65
    IntelliJ navigation find shortcut keys
    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 10:
    Interrogation
  • 66
    Introduction to 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.
  • 67
    Driver level Interrogation exercise
    01:20
  • 68
    Driver Level Interrogation Exercise - Sample Answers
    10:30
    An example test answer shown, and refactored to use assertThat and @BeforeClass & @AfterClass - reasons for doing the refactoring are also explained.
  • 69
    DOM Element Interrogation Introduction
    12:15
    An overview of DOM interrogation. How to locate with findElement and the initial set of By locators
  • 70
    First findElement & By exercise
    01:37
    Throw you in at the deep end with an exercise using findElement and By. This should take about 20 minutes or so.
  • 71
    First findElement & By Exercise - Sample Answers
    07:29
    An overview of the sample answers for first findElement and By exercise.
  • 72
    findElements Introduction
    02:13
    An overview of the findElements method.
  • 73
    findElements Exercise
    01:18
    Explanation of the exercise to test your understanding of the findElements method. The exercise should take 10 to 15 minutes to complete
  • 74
    findElements Exercise - sample answer
    05:34
    An overview of find elements sample, with a preview of xpath usage and demo of findElements which does not match.
  • 75
    Chaining findElement and By support classes
    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 11:
    CSS Selectors
  • 76
    CSS Selectors
    17:59
    An overview of CSS selectors, and the By.cssSelector location method. CSS selectors are explained using FirePath in firebug.
  • 77
    CSS Selectors Exercise
    01:51
    Create some tests using By.id etc. and convert them to use By.cssSelector
  • 78
    CSS Selectors Exercise - sample answers
    06:26
  • 79
    CSS Selectors - Paths
    05:53
    Covering popular path selection methods for CSS, parent > child, ancestor descendant, sibling + sibling, and :first-child
  • 80
    CSS Selector References
    Text
    The list of CSS references from the slides, with a short description of each link.
  • SECTION 12:
    XPath Selectors
  • 81
    XPath Introduction
    08:22
    An over view of XPath selectors, online references, and examples of using them in Firebug and JUnit.
  • 82
    XPath Exercise
    00:37
    This should take about 5 minutes, create some tests using By.id etc. then convert to By.xpath
  • 83
    XPath Exercise - Sample Answers
    03:51
    Sample answers for the XPath exercise
  • 84
    Xpath CSS Rosetta Stone Reference
    02:21
    An additional pdf resource to help with CSS and XPath http://bit.ly/RDJ3Wb
  • SECTION 13:
    Manipulation
  • 85
    Manipulation Introduction
    01:51

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

  • 86
    How to be overconfident really quickly
    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.

  • 87
    WebDriver Wait Introduction
    05:07

    An overview of WebDriverWait and the ExpectedConditions helper class

  • SECTION 14:
    Manipulation - Exercises
  • 88
    Manipulation Exercises Introduction
    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.

  • 89
    The Manipulation Exercises List
    Text
    So you don't have to keep the slide open, this is the list of exercises for Manipulation, this will take about 30 mins to an hour


  • 90
    Manipulation Exercises Sample Answers Introduction
    01:38

    An introduction to the sample answers, describing an update to Firefox 16 and how the tests have had to change and new synchronisation added

  • 91
    Manipulation Exercises - sample answers question one
    06:28

    I submit the form in as many different ways that I could think off, and I'll explain the cross browser issues associated with this. I also caution you on going 'too far' with your automation and try not to test 'in built' browser functionality, unless you want brittle tests.

  • 92
    Manipulation Exercises - sample answers question two
    02:47

    Look at the clear field and send keys for comments, and consider if waiting for page is necessary in these tests.

  • 93
    Manipulation Exercises - sample answers question three
    02:23

    Overview of the answer and explain tests with conditional statement to help them setup prerequisites for the test.

  • 94
    Manipulation Exercises - sample answers question four
    04:41

    I created two examples, one more robust than the other, and I discuss how I could make it yet more robust.

  • 95
    Manipulation Exercises - sample answers question five
    09:07

    Four different ways of implementing the answer, explained. With an example of refactoring common code into a private method.

  • 96
    Manipulation Exercises - sample answers question six
    03:52

    Demo of the answer to question 6

  • 97
    Manipulation Exercises - sample answers question seven
    03:07

    Demo of the optional upload file and dealing with file dialog exercise

  • 98
    Manipulation Exercises - Summary and retrospective
    04:54

    Summary of the manipulation commands covered. Discussion of 'not getting hung up on file browser dialogs'. Demonstration of how I use tests to answer my own questions about the API. Remember to model the intent of your test and check that the WebDriver API does the same as the real world. A little more information about SendKeys and modifier sequences.

  • SECTION 15:
    Manipulation - Select Helper Class and IntelliJ API Exploration
  • 99
    Demo of experimenting with API using IntelliJ Evaluate Functionality
    03:46

    How to use intellij evaluate functionality to experiment with WebDriver API, using sendKeys as an example

  • 100
    Overview of Select Support Class and Exercise
    01:59
    A quick description of a helper class that comes in the Selenium support packages to make working with select elements more literate and simpler.

RATING

  • 50
  • 3
  • 0
  • 0
  • 2
AVERAGE RATING
NUMBER OF RATINGS
55

REVIEWS

  • Harry King
    Fantastic!

    Alan breaks down each subject into easy to follow chunks and covers all the areas you need to be aware of to build a top notch test automation environment with Java, Selenium and Jenkins. Alan not only keeps the course up to date, but responds to queries posted to his students. I cannot recommend this course enough.

  • James Macdonald
    Extremely interesting and useful

    Excellent course, covering a great deal of ground - and one that I will continue to constantly refer back to. I've undertaken numerous Udemy courses and the quality of this one is way above the average. Hard work at times if, like me, you come without programming knowledge but who doesn't want to be challenged as they learn? Alan is also the best tutor I've come across on Udemy in terms of responding promptly to questions and suggestions.

  • Ryan Bedino
    Brilliant!

    With limited knowledge of Java, I was asked (as a manual tester of 8 years) to head the automation initiative at my place of employment. I began coding and everything was working great, and only THEN did I happen upon this course by way of a colleagues suggestion. The course presented everything I had done, but in such a way that I was able to refactor and make things better. I also learned enough theory and practical advice to make me confident in continuing with more challenges. This course is easy to follow, robust in its presentation, and absolutely critical to anyone entering the realm of QA Automation. I thank Mr. Richardson from the very depths of my being for enriching my knowledge of the subject. His enthusiasm is inspiring and makes for a turkey engaging experience, that for me personally has developed into a reinvigoration of my love for testing!

  • Harsha Yogasundram
    Superb course!

    One of the best technical courses I've been on, really nailed the subject for somebody who's technical but doesn't know much Java. I'm already creating Webdriver frameworks in my current role and look forward to learning more in the future. Well done Alan!

  • Bey Melamed
    Everything you ever wanted to know about ... but did not even know the questions

    Very comprehensive basic knowledge about Automation, Automation tools, Java & Tools, methodology and more... Usually 'and more, much, much more' is meaningless but in this case it is absolutely true. Aside of the basic Alan provides you with the compass and the map to explore more on your own. I would recommend a bit more details about the IntelliJ IDE but this course is not about this topic so i fully understand that choice.

  • 30 day money back guarantee!
  • Lifetime Access. No Limits!
  • Mobile Accessibility
  • Certificate of Completion