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 process of using an ID to identify elements wth Selenium Webdriver of the Elements Identification course.
Selenium Tutorial – Using an ID to Identify Elements with Selenium Webdriver
So my point about ideas is that they are the best element to use for identifying your object. Now let’s go ahead and actually transition that to C-Sharp and selenium web driver. So if you guys go to my code too and voila the loud light palm framework tutorial and then what you can do is if you have a good hard look around you can obviously clone if you don’t you can just download the zip file download the zip file extract the code and you’ll be able to follow along in this tutorial. So that’s what I have here in the solution explorer on there element identification test into T-P tests project you guys can see here.
I have a bunch of element identifiers that we’re going to go through for so many and web driver because that’s our ultimate goal right is to master this thing. So if we want to find an element using an ID we need to do that. So I’m going to do control. K you too on comment and we can run this test now here on top of the test I set up a static driver that is going to open up Chrome for us a element called element and then a locator which I use further below. So the first step that we do in our test day is we go to a trial which is our Web page and then we find the element using that ID and then we click on it and then the other thing that we need to do is go back because once we click on the element we want to go back to that element.
So we’ll actually debug through this so that you guys can see what’s happening. So I’m going to go click here and then do debug and then it’s going to run up to this point. So I get to my unit test runner here with me pinnate. Here comes crome. I’m going to put it on the side and then my visual studio on the left side.
Now this page open up this line right here uses the driver that we created up here on top. It’s a static one so you don’t need to recreate it again. It has a find element method using a locator called ID and which button do we want to click on. Well let’s take a look at our Firefox. I’m actually clicking on this button here. So if my selected ID is example and you guys can actually see here and the HDMI will remember what we learned here is the property. And here’s a value and that’s exactly what we want. We’re using this I.D. and it’s values I.D. example. And so I just put that in here. And then if we’re successful it should click on that button. So I’m going to go ahead and step over this. Now we have this element stored in a variable.
And you guys can see all the information about it in here. Something like even a text No text. And then we can step over this and it is going to perform a click action. And look at that. You guys see that it clicked on it on buttons success and it was successful it’s clicking.
And now this action here is going to take us back step over and that’s going to use the browser to take us back. Fantastic. Stop that.