In This Course
Did you know that a recent poll revealed that 80% of QA Automation Engineers cannot run more than 100 functional tests daily, with 95% reliability? Furthermore, over 50% of these Automation Engineers struggle to run between 0 – 50 automated functional tests per day!
Functional test automation is a hard job. However, you can make your job much easier by learning a pattern known as the Page Object Pattern. The Page Object Pattern helps to resolve a lot of the problems that other automation techniques cannot. Making your test automation more stable as a result.
This course is designed to teach you how to properly code the Page Object Pattern using Selenium Webdriver with C#.
However, all of the information here is equally applicable to any other functional testing tool because the Page Object Pattern is a universal principle that makes test automation more robust. Similar to other universal concepts such as Don’t Repeat Yourself or Single Responsibility Principle.
Therefore, if you know Object Oriented programming and a different functional automation tool, you can still comfortably follow along with all of the principles and patterns that I lay out in this course.
In this course, you will learn:
– Why other methods such as Record & Replay or Keyword Driven do not work when it comes to test automation
– What the Page Object Pattern is in automation
– Advantages and disadvantages of the Page Objects
– Amazing tips and tricks on how to:
- Implement the Page Objects using Selenium Webdriver
- Improve your Page Objects to follow DRY Principle
- Improve Page Objects to follow SRP Principle
- Create amazing Page Objects for gigantic web pages
In This Lecture
In this video, we will go through the writing the first functional test for the large page.
Selenium Tutorial – Writing the first functional test for the large page
Let’s go ahead and code out two quick tests. And then I’ll work through with you on organizing those tests and cleaning up all the page objects so that they are smaller and more readable. So I got my ID here let me pull up the web page on the right hand side so that we can look at it while we do some coding. So bear with me as I just coded it this out and then I’ll explain everything after.
As always I’m going to start by writing the test using test driven development methodology. Then we will do the implementation. So for the first test I’m thinking of just clicking on one of these buttons and making sure that it goes to the appropriate page. So let me write that test.
OK. So here is the skeleton of the first test. What I’ve done is obviously created a new instance of the complicated page. We navigate to the page and then I have a validation point where I check that the complicated page has opened successfully. Afterwards I’m going to click the first Twitter button and over here I was struggling a little bit trying to decide what should I do should I validate that we’ve successfully navigated to the Twitter page.
And then I thought about and said no that’s not really necessary. It is because the Twitter page is none of our concern here and I don’t want to take you guys down a different path. So rather than doing that what I’ve done is asserted that the complicated pages that method returns false. So meaning that we have actually left the complicated page and we are adding a new page and that should be sufficient enough to tell us that the Twitter button was successfully clicked.
Now let’s go ahead and actually implement all of the code