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 the analysis of ObjectRepository implementation of the page objects in test automation course. In this video, we will go through the Implementation ObjectRepo for StudentDashboard for the course.
Implementation ObjectRepo for StudentDashboard
Let’s go ahead and apply this functionality to the rest of the pages and you will learn along the way what I’m going to do is just go through the errors that the compiler is now throwing because obviously, we’ve got a new functionality to the base page class so we’re going to go through and fix those functionalities for each of the pages. So here it’s going to take me to the student dashboard page which implements the base page class. And if we hover over it complains that using generic type base page requires one type argument.
So we’re going to fix this by passing in a type of dynamic type of object repository that it requires We’re going to call this student dashboard page object repository and of course now the compiler is going to complain that it doesn’t exist. So utilizing Reise sharper. I’m going to create a type called Student object repository. And this is a class that we created here. And if we look at this there is going to complain that our class that we just created doesn’t contain a parameter or less constructor. So again utilizing my ID I’m just going to implement the missing members. So now that we implemented the missing members This class is sufficient. You can see how our student dashboard page is going to create the base page object repository inches pass and the driver so that the base page object repository can store a reference to our Web driver. I’m going to move this into its own file saw pick this selection over here just so that it’s cleaner. Let’s go back to our student dashboard page and fix the rest of the errors.
So now you can see that over here in the constructor the compiler is complaining that there is no argument given that corresponds to the required formal parameter repository of base page. So what we need to do is if we look at the base page constructor we can remember that it requires a dynamic type of the object repository. So we just created that object repository. So all we have to do is to initialize it so that the base page has a reference to that class.
New students dashboard page object repository is initialized and ofcourse the compiler complains that there is no argument given and that corresponds to the formal parameter driver.
So we just need to in driver so that now our base page is going to be initialized with a driver that the base page is going to store and our object repository is going to store a driver. So now what that’s going to allow us to do is remove these properties from our student dashboard page and store them in the object repository. So I’m going to go ahead and select these.
I’m going to navigate to that definition here and payes these properties here.
So, of course, this one is not going to be private any longer. Going to make it public and now will say this and go back to our student dashboard page. And of course the student dashboard page is now going to complain that HTML tag doesn’t exist and neither does resume user interaction scores button. But that’s very easy to fix because now in our base page class we have a reference to the object the repository. So utilizing the object repository we can get our elements that now live there object repository Da’ath and you can see all the options that come up which are Abita the two elements that we have in there and we one of them is HTML Alt tag Also we can do the same thing here Dot. And resume user interaction course. Bawden now also exists in our logic repository so you can see how amazing that is because now whenever we need to interact with an element we store it in the object repository and we access it using the object repository member