What will you learn in this course?
Are you struggling with working with HTML using Selenium WebDriver? Do you know how to easily identify and manipulate an element using Selenium WebDriver? How about performing a drag n’ drop on an element? If not, then these are just a few of the questions that will be answered in this course.
This course is a complete guide on working with web elements in Selenium WebDriver! Once you are finished with this course, you will know how to work with any web elements, anytime, on any web application.
In this course from Ultimate QA, you will learn:
– Basics of HTML
– All the different locator strategies for Selenium WebDriver
– How to identify web elements using Selenium WebDriver
– Master XPath
– Navigation with Selenium WebDriver
– Web element manipulation
– Web element interrogation
– Mouse and keyboard actions with Selenium WebDriver
– Performing actions such as drag n’ drop, drawing, hovering
– Implicit and Explicit waits
– How to properly handle element identification so that your tests are not flaky
– Expected Conditions in Selenium WebDriver
What will you learn in this lecture?
In the previous video, we learned executing the solution to the quiz of the page objects in the test automation course. In this video, we will go through the advantages and disadvantages of the page object pattern of the course.
Advantages and disadvantages of the page object pattern
OK so over the next few minutes I want to cover a little bit of theory with you guys before we dive deep into the code and gain a really good understanding of how to design a wonderful page object. Some advantages of the page objects are and the main one being is that it provides a layer of abstraction for us. It encapsulates the HVM page inside of our class so that our tests don’t directly talk to each DML page. Rather our tests talk to the aged l page through the page object abstraction that we have created that is the main beauty Rigaud over the page object and why it makes the code so maintainable. Furthermore it is just a logical lay out of how a coach should be structured. Right. You have a page in HCM I’ll page that is represented in a page class and if you want to interact with that page some way they check them all page in some way use utilize your page class to interact with that page.
Furthermore as you guys are going to see in a few minutes it makes your tests so readable so readable that almost anybody can understand it. As long as your method naming conventions are well-formulated your tests are going to be readable just like an amazing and novel. The final benefit of a page logic pattern is that it follows good design principles and that’s the other advantage that it has over any kind of automated functional testing design for tests. Some of the main design principles that it follows is the dry principle that tells us to. Don’t repeat yourself.
The problem with the keywords different the framework was that it was not dry everywhere that you looked. You could see repetition and so therefore it was wet not dry at all. We wrote everything twice. A wise man once said. The duplication is the primary enemy of a well-designed system. And what is that need for us is CU engineers. It means that if we want to have maintainable tests that are resilient that nobody claims that they are brittle then those tests should not have any duplication.
Now the page object pattern does have some disadvantages as everything in software development. Nothing is usually black and white. A lot of stuff has some positives and negatives. Some of the negatives of the page object pattern are that it has an increased barrier to entry. Yes you can’t just dive right in and be able to write classes and methods and be able to structure everything very well to get a good page object pattern going. So it does have an increased barrier to entry where you need to learn a little bit before you can actually start doing it.
The other biggest problem that I keep running into is that there are many different options because a lot of it involves actual development. There are many different paths that you can take to come to the same solution and I’ve read it probably at least 20 to 30 different solutions on Page object patterns utilizing many different ways and all of them have benefits and negatives. So sometimes it can Konna just twirl your head around in a whirlwind while you try to figure out what is the best way to implement something.
The final disadvantage of the page object pattern and in my opinion it’s not really a disadvantage but for some of you it may be is that it requires constant improvement because you are actually doing a lot of development work. You do need to constantly improve your automation framework and your page object pattern so that you remove the duplications and you remove all of the possible sources where a change can break your automated functional test. You always need to be on top of that and always on top of that still every day I’m learning something new that can improve my page object pattern to be that much better hayride.
So with all of that theory in place let’s go ahead and dive into the code so that we can better understand how to utilize the page object pattern and what it really is.