Selenium WebDriver with Python - Basics to Intermediate

Learn step by step how to automate web applications using selenium webdriver with an easy to learn programming language.
4.3 (158 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
2,234 students enrolled
$30
Take This Course
  • Lectures 81
  • Contents Video: 3.5 hours
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

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.

About This Course

Published 8/2014 English

Course Description

*******************************************************************************************************

Take this course and develop solid selenium tests quickly using a scripting language like Python.

This course covers:

  • Selenium installation on several platforms (Windows, Mac OS X and Linux Ubuntu)
  • Locating elements on a web page using XPATH, CSS SELECTORS etc.
  • The Selenium Webdriver Python API
  • Organizing and refactoring your selenium tests code
  • Implementing Page Objects and UI Mapping in order to make your selenium code maintainable.
  • Collecting selenium tests automatically using Nose so that you don't have to create manual test suite files.
  • Distributing Selenium Tests using Selenium Grid
  • The best practices when writing selenium tests

All concepts are explained using hands-on examples. You will apply your skills on a real web app built especially for this course.

*******************************************************************************************************

"""
This course helped me get an interview at Harvard University.
I have been trying to learn Selenium for ages, but I just wasn't getting it. Then I took a Python course, followed by this course. It was such fun! Because of this course, I was able to upload some coding samples navigating to my Github account, where I was navigating to the login screen and signing in using a test account I created.

The IT people at Harvard University liked it so much they are giving me an interview for a junior automated testing role. I would not be able to have been eligible without this course.

""

T.J. Maher

""
As title says Basics to Intermediate, it covers all

Very Good course, It covers everything from basic setup to best practices of writing solid tests. Best part is the use of unittest and nosetests which is very much required if we have lot of test cases to execute.

course will not only help beginners to start learning the basic concepts but will also help intermediates to understand best practices and managing test suites.

waiting for advanced section :)"

Ayush

""

If you want to learn Selenium with Python Bindings, Take this Course

Awesome course by an extremely helpful and well-organized professor. Clear instructions, lots of good examples and exercises, thorough, logical. Can't say enough good things. Gabiste is very helpful if you have any questions as well. Can't recommend enough.

""

Matt Vaccaro


*******************************************************************************************************

What are the requirements?

  • Environment: MAC OS X, Windows or Ubuntu Desktop. Most of the tutorial uses MAC OS X but you will still be able to follow using Windows or Ubuntu.
  • Mac OS X and Ubuntu users: A system with Python 2.7.x is required for this training. OS X Lion, OS X Mavericks, Ubuntu 12, 13 or 14 come with Python 2.7.x already pre-installed.
  • Browsers: Firefox, Chrome and/or Internet Explorer.
  • Be comfortable with the command line.
  • Basic knowledge of Python.

What am I going to get from this course?

  • By the end of this course, you will be able to build solid selenium automated tests using Selenium Webdriver Python API.
  • You will learn how to install selenium on different platforms (Windows, Mac OS X or Linux Ubuntu).
  • You will know how to locate web elements using XPATH or CSS Selectors.
  • You will learn how to apply actions (clicking an element, sending keys to an element, selecting an element from a drop-down list etc) to web elements.
  • You will learn how to queue selenium actions using ActionChains.
  • You will know how to organize your selenium tests code in packages and how to wrap selenium calls.
  • You will learn how to leverage concepts like Page Objects and UI Mapping in order to make your selenium tests code maintainable.
  • You will know how to use nose to collect selenium tests without the need of manually creating a test suite file.
  • You will learn how to distribute your selenium tests using Selenium Grid.
  • You will learn the best practices when writing your selenium tests.

What is the target audience?

  • QA Engineers and Developers

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
02:26

Welcome message and tutorial quick overview.

00:36

This lecture highlights what you should know before taking this course.

01:57

This lecture briefly describes each component of selenium.

00:57

This lecture explains how to navigate this course. Where to get the installation instructions PDF? where to get the locator strategies (Xpath or Css Selectors) cheat sheets? etc.

Section 2: Installation and Configuration on Mac OS X
00:17

In this lecture, I give a brief description of the tools that we are going to install. I am also attaching the installation instructions as downloadable content.

02:53

In this lecture, I show you how to install Firebug, FirePath and Selenium IDE.

03:03

In this lecture, I show you how to install the ChromeDriver server which is needed to run tests on Chrome.

00:44

In this lecture, I am installing the Java SDK.

01:39

In this lecture, I show you how to install pip which a tool for installing and managing python packages.

00:52

In this lecture, I am installing selenium from the command line.

01:15

In this lecture, I am overwriting the "PYTHONPATH". This is important as later on we are going to use relative imports.

Section 3: Installation and Configuration on Windows
00:22

In this video, I give you a brief description of the tools that we are going to install.

01:30

In this video, I show you how to install Firebug, FirePath and Selenium IDE.

02:35

In this video, I show you how to install and configure Python 2.7 on your Windows environment. I am using Windows 7 Professional for this installation.

02:00

In this lecture, I show you how to install pip which a tool for installing and managing python packages.

00:39

In this video, I show you how to install Selenium Webdriver Python Bindings through Pip.

01:54

In this video, I am installing the JDK On windows.

01:03

In this video, I show you how to install ChromeDriver standalone server which is needed to run tests on the chrome browser.

01:29

In this video, I show you how to install the IEDriver server that matches your Windows system type (32 or 64-bit). We are going to use IEDriver to run tests on the Internet Explorer browser. In this tutorial, I am using Internet Explorer 9 running on Windows 7 Professional 32-bit.

01:37

In this video, I am configuring IE Protected Mode settings. This is required for certain IE versions.

Section 4: Installation and Configuration on Ubuntu
00:18

In this video, I give a brief description of the tools that we are going to install.

03:52

In this video, I show you how to upgrade Firefox and install Firebug, FirePath and Selenium IDE.

01:59

In this video, I show you how to install Chrome using the terminal.

02:29

In this video, I show you how to install the ChromeDriver standalone server which is needed to run tests on the Chrome browser.

00:44

In this video, I show you how to install Java SDK using the terminal.

01:50

In this lecture, I show you how to install pip which a tool for installing and managing python packages.

00:35

In this video, I show you how to install the selenium python bindings using Pip

01:39

In this video, I show you how to overwrite the PYTHONPATH on Ubuntu. This is needed as later on we will use relative imports.

01:26

In this video, I show you how to install the Sublime Text 2 Editor from the terminal. This is the IDE that we will use to write our selenium tests.

Section 5: Overview of Selenium IDE
08:04

In this video, I give you an overview of the Selenium IDE features. Selenium IDE is a tool to record and playback tests. In this lecture, I also show you how to record and playback your tests using this selenium tool.

01:20

In this video, I explain the difference between an Assert and a Verify command. Understanding these checks is really important since these are two commands that you will have to use when testing web applications with selenium.

02:13

In this video, I show you how to create a test suite in Selenium IDE.

00:40

In this video, I discuss some of the limitations of Selenium IDE. Selenium Webdriver is the tool you should use if you want to develop robust tests.

Section 6: Creating My First Selenium Test
01:45

In this video, I show you how to navigate to a web page using Firefox, Chrome or IE drivers.

05:37

One can use either Implicit wait or explicit wait to wait for web elements. In this video, I explain the difference between the two.

Section 7: Locating Web Elements
00:45

In this video, I give a quick description of Xpath and Css Selector.

02:26

In this video, I am showing you how to locate elements using Xpath. You need to have Firebug and FirePath plugins installed. You will also find attached a Cheat Sheet (PDF) of some basic Xpath locators.

02:26

In this video, I am showing you how to locate elements using CSS Selector. You need to have Firebug and FirePath plugins installed. You will also find attached a Cheat Sheet (PDF) of some basic CSS locators.

00:45

Dynamic elements can be really challenging to locate. In this video, I give you some tips on how to properly locate them.

01:17

In this video, I compare locator strategies (Xpath and Css Selector). Does Css always perform better than Xpath? Find out in the video.

03:12

Now show me what you got :-).
In case, you have a hard time seeing the links in the excercise:

http://travelingtony.weebly.com/contact.html

http://travelingtony.weebly.com/store/p1/Leatherback_Turtle_Picture.html

Section 8: Overview of Python Unittest Module
01:13

In this video, I am giving an overview of the Python "unittest" module which is the equivalent of Java "Junit". This lecture is really important as we will use unittest to write our selenium tests.

02:40

In this video, I explain how a basic test case is structured: setUp(), the test and tearDown(). I also run a test case and show you what the report looks like.

01:24

In this video, I provide a list of some of the assert methods. I also show you how to use them in your test cases.

01:32

In this video, I show you how to create a test suite.

Section 9: Webdriver API: Finding Element(s) and Applying Basic Actions
08:17

In this video, I show you how to find element(s) using the Webdriver Python API. There are several methods to find either an element or a group of elements. Understanding this is really important when learning Selenium Webdriver since selenium applies actions (click, send keys etc) on web elements.

00:34

What method should you use to find an element or elements? This is what I am discussing in this video.

02:16

Time to apply actions on elements using selenium webdriver API. In this video, I show you how to click on an element and how to send keys to an element.

02:38

Selecting an option from a drop-down is one of the common actions when using selenium webdriver. In this video, I show you how to do it using two methods.

01:56

In this video, I show you how to get a web element text or attribute.

02:00

Now it is your time to shine :-).

Section 10: Webdriver API: Switching Focus to a Window, an Alert or a Frame
02:33

In this video, I show you how to interact with elements inside a web page that opens as a separate window. Selenium webdriver provides a method to switch focus to such a window. Find more in the video :-)

01:52

How to switch to an alert? How to accept or dismiss an alert? I answer these questions in this video.

01:33

In this video, I show you how to switch focus to a frame. Selenium Webdriver won't interact with any elements inside a frame unless the focus is switch to that frame. Watch the video to see how this is done.

01:01

Your time to shine :-).

Section 11: Webdriver API: ActionChains
01:01

There is a way to store actions (hover over, clicks, send keys, ) in a queue and execute them in the order they are queued up. You can achieve that using ActionChains. In this video, I give you a quick overview of ActionChains.

05:39

In this lecture, I show you how to hover over a menu and click a submenu. This can be achieved using ActionChains. Find out by watching this video.

03:46

In this lecture, I show you how to send keys to a web element using ActionChains. You can send keys to a field, a button etc.

01:06

Your time to shine :-)

Section 12: Organizing and Refactoring Your Code
05:57

In this lecture, I show you how to organize your selenium tests code into packages and how to wrap your selenium calls in order to avoid code duplication. I also show you how to deal with tests that require logging into a website.

01:00

Your time to shine :-). Once you complete this exercise, you will be able to write solid selenium automated tests on your own.

Section 13: Design Patterns: Page Objects
04:29

Your selenium automated tests code should be maintainable. You can achieve that by using Page Objects. In this video, I am explaining the Page Objects concept.

18:02

In this video, I show you to add Page Objects in your tests code.

05:57

Watch this video to learn how to test your website navigation using Page Objects.

01:00

Your time to shine :-).

Section 14: Using a UI Map in your Tests
04:30

Keeping your locators in one central location is really important. It makes it easy to maintain your code. In this video, I show you how to put your locators in one place using a UI Map and I also show you how to make them human-readable.

00:30

Your time to shine :-).

Section 15: Testing Made Easy: Nose
02:37

Nose extends unittest to make it easy for you to manage python tests. With nose, you no longer need to create test suite manually. Nose can collect all your tests and run them. Find out how nose can do this in this video...

11:13

In this video, I show you how to collect tests with nose and we also explore some of nose options.

01:01

Your time to shine :-).

Section 16: Selenium Grid: Distributing Selenium Tests
02:36

In this video, I give a quick overview of the Selenium Grid tool. What is a hub? What is a node? How does the Selenium Grid work?

07:18

In this video, I show you how launch the hub which is the controller of the Selenium Grid. I show you how to launch it from the command-line and using a json file. Find out more in the video.

08:52

In this lecture, I show you how to register a node. This is really important since before running tests on a node, the hub has to know the capabilities that are available on that particular node.

06:20

In this lecture, I show you how to run Selenium tests on a node. In order to achieve that, we need to send the desired capabilities to the hub which should then redirect the tests to the appropriate node. Watch the video to learn how to that using Selenium Webdriver and Python.

3 questions

In this quizz, we will see how well you understand the Selenium Grid tool. You can always rewatch the lectures if you are unsure about what the correct response should be.

Section 17: Best Practices for Writing Solid Selenium Tests
01:29

One of the basic principles of automation testing in general is to keep your tests independent from each other. Sometimes this does not seem obvious. How do you write independent tests? This is what I am discussing in this video.

00:32

Selenium Calls (Click(), send_keys etc ) should be wrapped in order to avoid code duplication. This is what I am discussing in this video.

00:51

Your tests source code should be understandable by anybody who has no selenium background. This is what I am discussing in this video.

00:38

Think about a web application that has thousand of tests. Running the entire test suite will take a long time. We can group these tests so that we only run the ones that we need. This is what I am discussing in this video.

00:50

Documentation is really important. We should create a central location where we document our selenium tests. What should we document? Please watch this video to find out...

Section 18: Conclusion
Conclusion
00:35
01:04

Selenium Webdriver Python API link:

http://selenium.googlecode.com/git/docs/api/py/index.html

SeleniumHQ (documentation on selenium) link:

http://www.seleniumhq.org/

Selenium project official site on google.com:

https://code.google.com/p/selenium/

Python nose:

https://nose.readthedocs.org/en/latest/

music by audionautix.com

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Gabiste Akoua, Selenium Consultant and QA Automation Professional.

With over nine years’ experience testing and automating applications, Gabiste is an expert Selenium consultant and quality assurance professional who is now prepared to share his knowledge on Udemy.

Gabiste has automated many web applications from end-to-end for desktop and mobile using Selenium Webdriver and Appium (with Python), and he has helped organizations from startups to well-established companies put in place solid Selenium automation frameworks and procedures, including training staff on their proper use. He is a strong proponent of using Selenium in the cloud, and he has implemented it for most of the companies he has worked with. He has built complex automation infrastructures that integrate code management systems like Github/Bitbucket, continuous integration servers like Jenkins, and cloud services like Sauce Labs.

Having recently discovered Udemy, he now wants to take advantage of that platform to share his experience and help others. Join Gabiste’s course to gain a deep understanding of Selenium Webdriver.

Ready to start learning?
Take This Course