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 how to use special operators in Xpath of the Elements Identification course.
Selenium Tutorial – How to Use Special Operators in Xpath
So here I have a few examples about everything we talked about and what I quickly wanted to show is these last two. Right. With these two slashes it doesn’t matter what the tag is. But we can skip everything and select the tags that we want. So if I scroll down here to this table right so this table for example if we look at a cell here it has a D inside of it t lift some text. Here check out another T.G. where some Tex lives and another tiddy table data and the table data lives inside of a TR which is the table roll. So if I want to select all of the table rows and you will know how I would do that. So far so I would put these double slashes right because we don’t care. We want to skip all of the parent structures and just get right down to the element that we want. And that would just be by putting TR here. And if I had Anner check it out it selects every single table roll. That’s what TR stands for.
And if I had Anner check it out it selects every single table roll. That’s what TR stands for table row. If I wanted the table body I can do I can do that. And now I would select every single table data that is on the page. You guys can see it select every single TV tag. If I wanted a specific one that’s a little different question. But for now this is how you use these double forward slashes. And now if I wanted all of the attributes like class I can do something like this.
So now it’s gone just like every single class attribute on this page. If I hit Enter it’s so luck to them if I wanted every single ID check it out see how it’s affecting every single ID if I wanted every single. How about Atra which is our link A-Trak and you guys see that it’s selecting every single link. So using this double slash and the at symbol and whatever attribute you want you can select exactly. You can select all of the attributes and then obviously we already went over this wildcard character just like anywhere else it matches any element node. And then this matches any attribute node. So take a look at that. So any element. No that’s how I was doing this. Right so if I hit Enter now what is it going to do is going to slide everything on the page. You guys see that. But then if I wanted to do that and then just skip to a certain attribute maybe I can do something like. Type. That’s not going to work.
Do you like that type all the Right so if I hit Enter now what is it going to do is going to slide everything on the page. You guys see that. But then if I wanted to do that and then just skip to a certain attribute maybe I can do something like. Type. That’s not going to work. Do you like that type all the types. And then if I do like this that’s going to select every single attribute on the page. You guys see that select every single attribute on the page. So you can use the star to skip through the HDMI to get to the point where you want. Is that also a wildcard character that we use everywhere else in all even in coding. And then finally I also want to talk about the pipe which can allow us to select multiple elements.
So for example if we go back to this table and I look at this table I can select all of these right. Check it out all the table data and I can select all of the tiaras table rows and table data or I can select all of the G-ds and just the table headers. You guys see that instead of the table data. How about I just select the table rows table rows and table headers. You guys see that how it’s not only selected here all the th is and all of the tiaras are selected. Yes you do. How cool is that. So that’s what the pipe does.