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, 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
In This Lecture
In this video, we will go through the process of how to identify radio buttons using xpath of the Elements Identification course.
Selenium Tutorial – How To Identify Radio Buttons Using Xpath
I’ll write you my friends. Let’s talk about radio buttons right radio bands check boxes all of you guys love them and they hate them at the same time because they are a pain in the butt. We have some radio buttons here and if we take a look at them take a look. First of all to check each of these items is their own elements. But not to mention that we also need to care about the text that is directly to the right of them. Right. But how do you check the appropriate box and read the text in order to make that happen. So if I want it to click on this one I love Quick Test Pro button.
You can see the HDMI out. So we have a form you guys see the form highlighted above in blue. This is our form inside of the form. We have several inputs. So we have input one can put two and input three just radio. This is the radio button you can see type radio. So it’s a radio band and then it has a value. How cool is that. Right so we can use that for example to select our appropriate radio button. And also it has a nother attribute called checked meaning that is a checked or not. So the other buttons. For example I love selenium web driver has checked equals to check out the other ones do not because they are not checked when they are checked. That is how you will be able to know which button is checked or not.
So if I wanted to select the second the one that I love. Quick Test Pro which I don’t anymore. I can use type radio and it has a value. I love Quick Test Pro right or even better we could probably do something like this and then do the value equals what I love. Quick test. Let’s hit enter. And that did not work. Let me copy this over and let’s see WHY did not work. So that didn’t work because the value of quick test. Let’s add an input Oh dear it’s I love Quick Test Pro AND I FORGOT THE PRO. And so of course there is no value with either of quick test.
There is a value with I love Quick Test Pro. It’s not a wild card character here. So I love Quick Test Pro you’ve got to see how that works. And so therefore that allows me to select the I love Quick Test Pro button and of course if you just want it you know to do like a wildcard character. You guys can do the at contains text. I love quick test in there and then if it contains that tax write is going to select it.
But with the value attribute you cannot do that because it has to be the exact full string. And so that’s how we can identify this radio button. And if we check it check out the AGM are below which need to reload. Oh and it was not checked and I apologize. I’m no expert but now I remembered that this actually means that this radio button is going to be checked by default any time the page loads. So that’s why it has the checked equals checked.