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?
How to implement the UserInteractionsCoursePage
So my Visual Studio IDE makes it extremely easy for me to implement methods that are written in a test driven development style and then be placed in the right location so I can use my ID and then it’s going to allow me to correct what I need to do and so you can see now I can create a method in the appropriate page which is exactly what I want to do and I’m sure I know that Java and many other ideas allow you to do the same thing. So we did that and now we just need to implement it. And so resuming the user interaction scores that involves what that involves clicking a button. So let’s go back to our Web site and then let’s spy on this resume Corps button and see what that’s about. So looking at this Dom I think I’m actually going to use this A.F. property in order to be able to click on this button.
We can go really deep into why we would want to utilize different kinds of locators. There are many different kinds of tutorials on that but that’s not the purpose of this course. So I’m not going to get really deeply into why you should use one locator over another. I’m going to utilize that XPath. So I’m just going to test out my XPath condition down here in Chrome developer tools. Awesome So that’s my path condition. We can see that it’s identified one of one buttons if I hover over it I can see that is the exact wand that I want so I’m going to grab the second bag. I’m going to go back to our ID and now I’m going to implement this method. It’s complaining about my resume user interactions of course button. So I’m going to create a property.
It’s going to be iWeb element and then I’m going to return by Xpath
Of course it a link to semi-colon awesome so here’s our element and I’m going to move this up to the top so it stays closer to all of the other locaters.
There you go.
So now this works excellent. However we have a problem here in that we need to click this button which is going to take us to another page. So we need to implement that here and return a. Let me see what we were calling you here a user interaction course page. User interactions course page. And of course that doesn’t exist. So I’m going to use my ID to go ahead and create a type called user interactions course page which is fantastic.
And of course all we need to do now is return in this method and user interaction of course page and passing a driver.
And of course the user interaction of course Page is going to complain that it doesn’t have this construct are implemented. So again using IEEE It’s really simple to create this constructor and the constructor is pre-created for me.
What I’m going to do here is assign just like up here. I’m going to have a property that stores our driver.
And then I’m going to assign the driver to our variable that’s passed then and now we have our user interactions course page.
What I’m actually going to do is move this to its own class so that now if we look here we have our user interactions course page that has been added in our page objects folder.
And now let’s go back to our test and see what’s left to implement.