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 the previous video, we learned the quiz answer to large page objects of the page objects in test automation course.In this video, we will go through on How do you clean up large page objects.
How do you clean up large page objects
I’m going to start cleaning up test three here and decreasing the size of our classes again.
I’m going to code all of this lie for you just follow along and then I’ll explain what I did after.
Awesome. So I’ve cleaned it up. If you take a look at the test you can see that what I started doing was utilizing touch human development. I wrote what I wanted to happen first. So we’re doing complicated page dot social media section which is going to take us to our social media section as we discussed and the social media section you can imagine it as an entirely different page that that’s going to manage all of the stuff related to the social media section and social media section.
It’s just a simple property that returns a social media page right just like any other pages we were to a social media page and actually let me clean it up. I can make this easier. Utilizing C-Sharp notation I can make those very nice and clean as such. So nice and clean right.
Anyway so that’s what that means I was a Geter that returns a new social media page and the social media page takes a driver just like all of our pages. And of course the social media page in here is from a base page and here you have an option.
You can either create a new page object repository just for the social media page or you can reuse the parents page object repository. I actually recommend that you create your own page object repository for each object just to be consistent.
But for time purposes I re-used the complicated page object repository page and it’s actually really easy if at any time your complicated page object repository gets really big which is going to in the case of this page you can easily just replace it with your new page object repository that you create for the social media page or for any page for that matter.
But again for the purposes of speed I just reuse the complicated page object repository. And of course everything else is exactly the same as for any other page. Let’s run this test to make sure that it actually works.