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 First look at a functional test using the page object model of the page objects in test automation course.
Selenium Tutorial – Page Objects in Test Automation First look at a functional test using the page object model
Here we have a test that is utilizing the page object model in order to test the functionality of the application. One more to caution that I’d like to give you guys is that there are numerous implementation of the page object model that I have seen many many different ones and I’m sure there are way more than I have seen. So this is just my attempt at utilizing the page object model to write automated functional tests. It may not be the most optimal way. And so if you have any suggestions that are going to make this better or my page object model better please let me know because I’m always looking to get my tests as good and as stable as possible. And I’m always willing to learn and take more advice.
So if you see it and just let me know I’ll be glad to hear it regardless. This is the page object test that we have been familiar and we’ve been working with throughout this entire series. The very first thing I’d like for you guys to look at is to compare this test in its form to our record a test. So let me pull up a new vertical tab group here and on the right hand side you obviously see my test utilizing the page object model and on the left hand side is our final version of the recorded test. This was the fix to the one where we finished implementing everything to actually get the test to run. Look at the difference. This test is about seven lines of code including spaces.
While this test is about twenty four lines of code with very little I mean yes it includes comments and spaces to look at the difference it’s drastically smaller in size compared to our record test.
Look at the keyword driven test compared to our page object.
The keyword driven test of course was a little bit smaller because it started utilizing methods. But again the keyword driven test is 15 lines in size versus the seven lines in size for the page object model. Now granted that doesn’t say much about the stability of the task the amount of lines of code. But what it does say is that our code is much smaller and cleaner. And as you will see it’s even easier to read than the predecessors.
So let me close these now.
Talking about readability of the test. Take a look at how easy it is to read this test. You create a new course a page utilizing that course that page you’re going to go to that page then utilizing the courses page you’re going to click the sign in link. Then you get a log in page using the log in page you’re going to log in entering the user and the password that I have stored in my environmental variables. Finally you’re going to assert that something is true and that something is the student dashboard page is at. How easy is that to understand. You went to the page you could design and link you log in and then you’re checking your lobbying at the right page. Again readability and extreme plus for the page object model