
In this course, we'll discover how Selenium Webdriver works, and how to use it to create testing frameworks. We'll see how the tests can and should look like to ensure our code is clear and simple, and how to organize and structure our framework to keep it maintainable and without unnecessary duplication.
We'll also talk about how to organize, use, and present test data and test results.
I recommend that you take this course if you are already familiar with programming basics and C# syntax. Apart from that, it doesn't matter if you are a tester or a developer, this course can definitely help!
Music:
Lobby Time by Kevin MacLeod | https://incompetech.com/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons Creative Commons: By Attribution 3.0 License
http://creativecommons.org/licenses/by/3.0/
Let's have a little reminder about .NET, what it is and how to install it and start a new project with it. It might be a good oportunity in case you only have experience with already existent projects or want to change your tech stack or development environment!
Music:
Meadows in the Sky by Artificial.Music | https://soundcloud.com/artificial-music/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
https://creativecommons.org/licenses/by/3.0/
One of the most popular tools for unit testing in C#. NUnit is simple to use, install, and combine with a number of other tools in case you want to do any kind of automation testing. We'll use it as the main test engine, and combine it with Selenium Webdriver to be able to automate Web UI testing.
Music:
Jazzy Night by Sakura Girl | https://soundcloud.com/sakuragirl_official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
https://creativecommons.org/licenses/by/3.0/
A little dive into NUnit assertions, which is what we use to determine if a test is passed or failed.
Music:
Meadows in the Sky by Artificial.Music | https://soundcloud.com/artificial-music/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
https://creativecommons.org/licenses/by/3.0/
Let's bfirfly see what Selenium Webdriver is and how to install it into a .Net project, along with any other packages we might need or want.
Music:
Midnight Stroll by Ghostrifter Official | https://soundcloud.com/ghostrifter-official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY-SA 3.0
https://creativecommons.org/licenses/by-sa/3.0/
Selenium Webdriver is an incredibly powerful tool to interact with web browsers, and one of the most commonly used tools for QA Test Automation, and front end quality control in general.
Let's explore it a little bit.
Music:
Jazzy Night by Sakura Girl | https://soundcloud.com/sakuragirl_official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
https://creativecommons.org/licenses/by/3.0/
In order to interact with a webpage using Selenium Webdriver, or any other tool, we need to be able to find the elements with which we want to interact. These elements can be anything from a button or an input field to entire sections of a page, anything within the HTML of the page.
It is important to know the options and tools we have to identify them, and which we can use with Selenium.
Music:
Jazzy Night by Sakura Girl | https://soundcloud.com/sakuragirl_official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
https://creativecommons.org/licenses/by/3.0/
When using Selenium Webdriver, it's important to be able to locate the elements within the webpage that we want to interact with.
Let's talk about how to use the different options available to us through Selenium Webdriver, so that we can find any element in a HTML document. This includes simple identifiers or locators such as id and name, but also more advanced and versatile locators like XPATH.
Music:
George Street Shuffle by Kevin MacLeod | https://incompetech.com/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons Creative Commons: By Attribution 3.0 License
http://creativecommons.org/licenses/by/3.0/
Time to actually write some tests using Selenium Webdriver. We can do this using only the basic concepts we know so far, and in fact this would cover most of the tests we would want to make.
Music:
Jazzy Night by Sakura Girl | https://soundcloud.com/sakuragirl_official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
https://creativecommons.org/licenses/by/3.0/
There are many different kinds of elements in Webpages, and one of the most common ones is the dropdown menu. Here we can see how easy it is to interact with them using Selenium Webdriver.
Music:
Subtle Break by Ghostrifter Official | https://soundcloud.com/ghostrifter-official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY-SA 3.0
https://creativecommons.org/licenses/by-sa/3.0/
One of the most common elements we see in webpages, and also one of the easiest interactions enabled by Selenium.
This is a good chance to practice finding and interacting with elements in a webpage, just as a user would.
Music:
Subtle Break by Ghostrifter Official | https://soundcloud.com/ghostrifter-official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY-SA 3.0
https://creativecommons.org/licenses/by-sa/3.0/
In modern, dynamic webpages, not all elements load at the same time, and this can cause issues for our tests. Fortunately, Selenium offers tools to handle this, and we have different ways of waiting for elements or events while running our test cases.
By learning about Selenium waits, we can make sure our testing framework is robust and trustworthy.
Music:
Midnight Stroll by Ghostrifter Official | https://soundcloud.com/ghostrifter-official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY-SA 3.0
https://creativecommons.org/licenses/by-sa/3.0/
Many times our tests are not limited to a single window or tab for any given webpage, and it is important to be able to handle these situations. Selenium gives us the necessary tools to handle this in a simple way.
Music:
Meadows in the Sky by Artificial.Music | https://soundcloud.com/artificial-music/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
https://creativecommons.org/licenses/by/3.0/
Although tables and the data inside the tables could be considered just like any other element in a webpage, the fact that they have a set structure, and that they usually contain a lot of information, gives us both an challenge and a chance to handle them differently with Selenium Webdriver.
Music
George Street Shuffle by Kevin MacLeod | https://incompetech.com/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons Creative Commons: By Attribution 3.0 License
http://creativecommons.org/licenses/by/3.0/
In order to interact with a webpage like an actual user would, basic interactions like clicks and key presses are not enough. Sometimes you need to perform complex actions such as hovers, drag and drop, etc.
Fortunately, Selenium also offers ways to perform these actions.
Music:
Subtle Break by Ghostrifter Official | https://soundcloud.com/ghostrifter-official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY-SA 3.0
https://creativecommons.org/licenses/by-sa/3.0/
A great example of how with Selenium and the actions class we can perform the most common interactions outside of the basic click or type. Here we can see how to interact with Sliders, some of the most common elements we find in all kinds of web pages.
Music:
Study and Relax by Kevin MacLeod | https://incompetech.com/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
https://creativecommons.org/licenses/by/3.0/
Even if the tools offered directly by Selenium are not enough, it provides us with a way to run JavaScript commands directly in the browser.
This is an incredibly powerful tool which allows us to interact with the browser and webpages in a completely different way.
Music:
Subtle Break by Ghostrifter Official | https://soundcloud.com/ghostrifter-official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY-SA 3.0
https://creativecommons.org/licenses/by-sa/3.0/
POM or the PageObject Model is one of the most popular ways in which we structure our testing frameworks with Selenium Webdriver, and with good reason.
It helps us create abstractions which mirror the page structure of websites, and makes our tests easier to maintain, write and scale.
Music:
Midnight Stroll by Ghostrifter Official | https://soundcloud.com/ghostrifter-official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY-SA 3.0
https://creativecommons.org/licenses/by-sa/3.0/
Time to see what an actual project looks like when using POM.
We'll see how to extract and modify Selenium's functionalities so that we can make our tests clear and direct.
Music:
George Street Shuffle by Kevin MacLeod | https://incompetech.com/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons Creative Commons: By Attribution 3.0 License
http://creativecommons.org/licenses/by/3.0/
Now that we have a basic POM project, we can also make other modifications to keep making it better. One of the first things we can do is make it support parallel tests, this way we can make our tests faster, as UI tests often take a long time and a lot of resources.
Music:
Study and Relax by Kevin MacLeod | https://incompetech.com/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
https://creativecommons.org/licenses/by/3.0/
Another way in which we can improve our project is by changing the way we manage test data. Often, we encounter tests which are basically the same, but with different data, and in such cases we do not want to repeat the same code over and over.
NUnit offers ways in which we can solve this problem.
Music:
George Street Shuffle by Kevin MacLeod | https://incompetech.com/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons Creative Commons: By Attribution 3.0 License
http://creativecommons.org/licenses/by/3.0/
Let's talk a little about logging and the importance of logging, not only in testing but in any kind of software.
Music:
Subtle Break by Ghostrifter Official | https://soundcloud.com/ghostrifter-official Music promoted by https://www.chosic.com/free-music/all/ Creative Commons CC BY-SA 3.0 https://creativecommons.org/licenses/by-sa/3.0/
Running the automated tests is not enough, in order to have a trully proffessional testing framework we also need to be able to share the results of the tests in a clear and readable way.
There are many ways we can achieve this, from developing a logging or reporting tool of our own, to using specialized packages or libraries, one of which is extent reports.
Music:
George Street Shuffle by Kevin MacLeod | https://incompetech.com/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons Creative Commons: By Attribution 3.0 License
http://creativecommons.org/licenses/by/3.0/
Let's see how we can quickly implement extent reports in the project we already have, and how we can start generating easy to read and visually appealing reports.
Music:
Study and Relax by Kevin MacLeod | https://incompetech.com/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
https://creativecommons.org/licenses/by/3.0/
A quick overview of the project with the most important points to remember:
How to create and run testing projects with .NET and NUnit.
How to use Selenium Webdriver to interact with webpages and create automated tests.
How to create a testing framework using a POM structure, and use it to create clear, maintainable tests.
How to handle test data, including reading them from external files.
How to generate simple and clear reports with the results from our tests.
Music:
Lobby Time by Kevin MacLeod | https://incompetech.com/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons Creative Commons: By Attribution 3.0 License
http://creativecommons.org/licenses/by/3.0/
Learn how to implement automated tests with Selenium WebDriver and NUnit, using the C# programming language.
Selenium is one of the most versatile (and popular) tools in the world of test automation, as well as a great tool for programmatically interacting with web pages. We will learn everything necessary about its functionality to implement our own automated testing framework.
In addition to learning how Selenium works, we will learn to create structured and scalable frameworks using POM (Page Object Model). It’s not enough to create tests; it’s important that our code is easy to read, maintain, and scale. To achieve this, we will explore a project structure that will help us with any functionality we want to add. We will also learn how to build clear and efficient tests, with the ability to run them in parallel using NUnit.
We will further enhance our framework with essential functionalities used in professional settings, such as handling test data and generating test result reports with the help of Extent Reports.
This course can serve as a solid foundation for creating high-quality test automation projects. Moreover, the basic concepts covered here are applicable not only to the tools and technologies we use but can also be applied even if you switch programming languages or testing tools.