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 the how to use Name property to identify an element of the Elements Identification course.

Selenium Tutorial – How to Use Name Property to Identify an Element


So the next property that we can use is the name property. Again not as good as ID is always the best. But if you must use it just make sure that it’s unique. The hardest thing for selecting web drivers always finding that unique combination of elements to help you identify the appropriate element and not anything else you want just enough properties to make the elements unique but not too many so that you’re just wasting time. So let’s go back to our Web site and take Kellog this Bodom uses the name property so we can use again firebug

So let’s go back to our Web site and take Kellog this Bodom uses the name property so we can use again firebug hover over it and click on that and you guys can see that it has a name called name. Example. So I’m going to copy that property. I’m going to come over here. Leavell get rid of all this.And again I want to do this for you guys on the fly with less explanations so.

See how I did that uncommon this control. OK you and then common this control Casey. And now let’s go ahead and run it. And of course I didn’t click do. And if we’re successful it’s going to click on this button and why won’t it click on any other button. Because I had specifically made this unique. Right. Look at all these buttons are exactly the same. They just have different content in the tags.So look at this one. And now let’s look at the third one. And the fourth one is also there for and it just has an ID so you guys can see the second one has it class the one below doesn’t.

They’re both type segments. Their values are obviously differently because I wanted to show you guys what each button Daus And then this one has a name property and this one does not. So obviously they’re almost the same. The tax is also a little bit different. I could have made them on exactly the same and just change one of the properties. But either way you can see how if we identified our elements correctly it will only click on this button and not the other button.

Now the second button.

So let’s open up our visual studio and I’m actually just going to go ahead. Come here and do a run so that you guys can see everything in real time. So you guys can see it started running the test here’s the browser. And actually it did not. It was too fast for you guys to be able to see the restaurant right. But you can see that the test passed. No errors were thrown. Therefore the test worked. So that’s how we know that at work. I wish it was a little bit slower but it’s ok I think you’ve got to get the point that a work.

Otherwise it would have thrown an exception like.

Oops. Check it out. It would throw no such element exception. You guys see that over here. No such element exception no such element exists so that’s how you know that your element wasn’t found. And then if you’re looking at the stack trace you can actually figure out where that happened at line 33 over here. So this finding the element broke which is exactly the problem because I made up this name and so there is no such object with this name.

And so it was not found

Pin It on Pinterest

Share This