So there's one other concept new concept that I want to bring up for you guys which we have
not dealt with before because it was not possible in the idea.
And that is the concept of returning a list of iWeb elements.
So one me put this query into our fire path and hit enter.
Do you guys see what it selects it selects right the three radio buttons and thats good
to know because we can have multiple elements returned to our object in so many web driver
and using this right here is exactly how we do it.
So we have our locator and this locator is going to return us three elements and those
elements rather than being stored in a variable like this.
They are now going to be stored in an eye list of iWeb elements.
Right.
And I-List it's an interface for a list with a bunch of eyewear Belman types inside of
it and we're going to call that elements.
The other thing to notice here is that rather than using the Find aliment method that we've
been using here we're using the Find aliments because we realize that it's going to return
us multiple elements when we put this in.
Let's run this and take a look at how that object looks once we're done with it.
Excellent.
So if I do a step over here and then scroll up and we hover over this elements you guys
can see that there are a total count of three elements inside of this I-List.
And if we expand that you guys can see just like in our flightpath we can use these brackets
to select which element we want.
So for example if I come over here to the watch and I do element's and then put brackets
0 and hit enter.
It only looks at the first iWeb element returned from.
Into this I-List and you guys get y 0 right because in C Sharp a list any collection is
populated from zero index and an X path.
It starts with one.
So just keep that in mind but we are populating this C-Sharp I list which starts at zero.
And so you can see that this element the first one can be identified by zero.
And if you want to hover over here and expand this and expand that we can see that this
element is tag name input and then if we for example want to click here at.
Let me bring this over.
By the way you guys see how this is always checked every time you open a fresh browser.
That's because of that check the property check equals checked.
So if I do this and then I come in here and I can do that.
Click.
Oh yeah that won't work because you cannot convert it to a group.
But what you can do is using these elements you can now circle through them and do stuff
with them like click the first one or click the second one or check to see if an element
contains text using the text property.
But it doesn't have anything because it doesn't have any text bar.
So now you can get this collection and you can work with this collection and do whatever
you need depending on the element that you want.
So this is new but it's going to be used throughout a lot of our lecturers to help you guys better
work with selenium objects.