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

Take This Entire Course for Free

What will you learn in this lecture?

In this video, we will go through how to use pick any tag from HTML body of the Elements Identification course.

Selenium Tutorial – How to Use Pick Any Tag from HTML Body

 

So just like any kind of location language there are a few expressions that you guys need to know in order to get the more familiar and understand expand better. So here I have created some tables. I got them all from W3 schools and you guys can obviously get more detail there if you want but I don’t think after this it will be necessary. I’m going to teach you guys as always the most essential things to become amazing. Automation engineers without wasting your time on things that you don’t need at all. So anyways there is this forward slash and that’s used to navigate to the different the next element in the tree and it selects from the root node. So for example if we go all the way up in our team all documented here. You guys see this. This right here document that is the root node.

So if I start with document and then I put a forward slash there that’s what it does. Right it doesn’t select anything. And then if I step into the HCM oul excuse me guys. Don’t start with the document not start with the HVM node. OK. So this is the root.

And then if I put a slash here and you guys can see that this HVM HDMI node has what we call two children. We have the had and we have the body. These two guys are called siblings. So if we want to navigate to see what’s in their head we can put the head here and then the firebug selects it or we can go inside the body. Look if I put body here see that how it’s selected the body. And now we can dig into the body’s children if we want. So why do you guys see that I expanded the body. Now if I want I can dig into a div So if I put a slash here and do a div it’s going to select all of the deaths that are the children of this body.

So you guys this is a hierarchy. This is the parent. And then this is the child of the HDMI node. And then this guy is the child of this body know that there are many of these guys. So all of them get selected because there are many Daves inside of this body. And so we can keep navigating like this see that as deep as we want until you guys see how narrowing down until we get to the place that we wanted and you guys can see how extensive that is. But this is how you form the absolute path. And that’s like that absolute address that you know but you want to visit a family. Right. You want to visit your friends and they live at a certain address.

You don’t have their phone number but you know where they live. And one day you go to visit them and those friends have moved in because you only know their absolute address. You won’t know how to track them down. So that’s what that forward slashes for now. You guys see how annoying that is right. So if I wanted to get down to this Forder I can use this double slash which selects a note in the document from the current no natural selection no matter where they are. So that’s kind of just let me skip anything I want so if I want to get to the footer I just have to put double slash here and boom I’m at the former right if I want to get to a div I put a double slash and then hit div and he’s going to select all of them.

And you guys can see what’s happening on the page or selecting all the divs if I want to get for example to this title tag I just do this title and it highlights that title but if it was just a single slash that’s not possible because I need to do body and then so on and so forth. I need to do again one by one HVM now that I need to do a body and then I need to dig down all the way until I get to the title. But if I don’t want to do that and I just want to get directly to the title double slash allows me to skip if I want to get Let’s see through this X power button to an input Tiga right. Do you guys see hear how it ends.

If I want to bypass all of this crap right here put another slash hit anner. Now you guys can see the problem that it’s selecting all of the input tags. And right now there are two but that’s OK. At least we skipped all of that crap. And now we kind of filter down and based on this we can dig in to where we want whether we want to hit this button or this button. So that’s what the double slash double forward slash does it allows us to skip to a certain time no matter where it is in the DML structure.

Pin It on Pinterest

Shares
Share This