What will you learn in this lecture?
In the previous video, we learned the introduction to HTML tags of this Selenium webdriver elements identification course. In this video, we’ll have the introduction to HTML attributes.
Introduction to HTML Attributes
Now in HTML, there are also things called attributes and attributes are used to provide additional information about a certain element. The attributes are also always specified in the starts tag.
So for example, we have our tag right here right. Start tag and tag. And here is an attribute.
And actually, an attribute is what a lot of us are used to identify elements. Probably if you’re coming from a TGP background unknowingly because they have that sweet object spy.
We have been using attributes a lot of the time to identify our elements. For example, ID and then it’s a value and then obviously we have the content inside of here.
So this right here is an attribute and there are many different types of attributes.
Let’s go back to our page. Take a look.
So look at this right here. This Bawden has an ID, its attribute is ID. And then here’s the attributes value ID, example enclosed in double quotes.
Here is actually another attribute that it has. It’s a type of submit and it has even a third attribute called value and then that value also has a string.
We can look at another element. Look this one is going to have a class.
So instead of an ID, it’s attribute to a class and then there’s a class value. We take a look at another button.
This one has a name property.
Check it out. The other ones didn’t have a name.
This one has a name and then it also has a type and a value just like all the other buttons.
What if we take a look at this link? Look at the link. It has a tag of A right and then you guys are seeing over here. This is the closing tag and then it has an href property which tells us that it’s a link and then it has this value which when we click on it, it’s obviously going to take us to a location which was link success which was exactly what was specified in the HTML out.
You guys see that. And then, of course, it has the tests that fit into this tag. Again take a look at some of these examples here.
So we have our tag, opening tag or closing tag and then sorry, this is the opening tag. Right because the attribute always goes into the opening tag. And then there’s also the closing tag which I didn’t put in here. But then we have the attribute and there’s value.
So for example we can have an H1 tag and that tag has a property value of ID and then the ID has a value ID value. We can have a div of tag and that has a name property and its value is value and we can even have an image tag and then that has a source property and that has a value.
Now what you guys may see here is that each of these tags and properties may have some meaning. And that’s exactly correct.
Right there like keywords in a programming language.
When you guys have been learning C# and learning all those keywords like for example public void’s static main string array. All of those are unique keywords right that have some meaning to C#.
Well, in HTML, all of these things also have some meaning in HTML. So H1 is a header tag H2 is another header tag but it’s a lower level header tag. IMG means that it’s an image. And usually it comes with a source tag that has the location of the image and inside of that we can even have some text.
So all of those have some meaning which is not really too relevant for you guys because you guys are not going to be designing actual web pages with what you just have to understand is what I described here is that we have our tags, the tags have properties that have some values, and using the tags and the values and combination of those we can start identifying our elements.
[Tweet “Learn everything about elements identification with Selenium Webdriver.”]
In the next tutorial, we will learn how to use Selenium webdriver for element identification.
What will you learn in this course?
Are you struggling with working with HTML using Selenium WebDriver? Do you know how to easily identify an element using Selenium WebDrriver? Do you know how to manipulate that web element? Do you know how to perform 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, any time, on any web application.
“Relevant content that I will be able to apply to my automation tests *immediately*, a VERY effective presentation approach (evolving the same example and comparing/contrasting), and an excellent teacher / presenter. Thank you so much for your time and sharing your knowledge Nikolay!.”
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
[Tweet “Learn how to correctly identify elements using #Selenium #Webdriver.”]
Nikolay Advolodkin is a self-driven SDET on a lifelong mission to create profound change in the IT world and ultimately leave a legacy for his loved ones, community, and the world at large. Today, he serves as the CEO and Test Automation Instructor at UltimateQA.com and contributes informative articles to leading test automaton websites like SimpleProgrammer.com and TechBeacon.com