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 this video, we will go through the Understanding why having a complex HTML page is a problem of the page objects in test automation course.
Selenium Tutorial – Page Objects in Test Automation Understanding why having a complex HTML page is a problem
Right here you can see the automation practice page. This is the ultimate slash automation link. This is kind of the home page to take you to different scenarios in regards to automated functional testing. I’m going to constantly keep expanding upon this page so that you have many kind of different scenarios to automate and practice as we go through our lessons. For now there’s only two but we’re going. In this case we’re going to deal with this big page with many elements. So if I can click this link and it will take me to that second your rail that I showed you or you can obviously just navigate directly to this URL and then look at this page. Now this is the complicated page with many web elements that I’m showing you. So you can see it has a bunch of different sections it has many buttons. It has many different kind of social media buttons and it has a section of random stuff that has different kinds of things like Search boxes contact boxes it has side bars it has a login boxes it has a carousel to navigate through different kinds of posts. It has toggles more contact boxes and so on and so forth. Obviously this is not a real page that utilize this is just something that I quickly created for you to be able to practice your functional test automation on. But you can see how many elements it has and how many different kinds of methods can be possible for this automation page.
In fact for me to better example of how this page would log if we were to write it let’s go ahead and do kind of a mock up of this page. Just so you can see how gigantic It can get. So take a look here what I’ve done is on the left hand side I’ve started a construction of our sample complicated page class that we would code for our functional test. And on the right hand side I have the actual HTML page so that we can look at it while we pretend to ride out the you and I’ll diagram for this. So if we just start at the section of buttons we can see that there are 12 different buttons that we can press.
So obviously we need locators for each of those buttons.
OK. So there are all the elements of the buttons. Let’s do the social media section. OK so I’m just going to leave it like this. Pretend that these are actually different properties. Twitter one two three four five Facebook button one two three four five just don’t feel like wasting your time with expanding all of this. So we’ve gotten through two sections than there are more sections here of random stuff.
So you can see how gigantic This page is already starting to get. These are just all of the elements then all of these elements are going to have methods. Right like clicking on getting the text sending text inside of web elements clicking the buttons searching so on and so forth is going to have a ton of methods. So probably what you’re going to end up with is a cloud that’s several hundred if not a thousand lines long and you can probably guess that that is a giant problem to have such a monolithic class having so many things to maintain. So that’s the problem. And the other problem is that technically if you’re following the page object model this on the right is a single page. So it does belong in a single page class. So if we were following the page object model we would be doing the correct thing. However after a little bit of time as you progress this class would become a mass and you would need a method a way to clean it up make it easier to read easier to maintain and easier to utilizing all of your tests