OK so there are many examples that we can go through here with user interactions.
Hope that you can yourself navigate through a ton of examples and utilize them as you
need.
But I didn't want to show you guys another tricky scenario that you may come across in
the future whenever doing some kind of user interaction automation and that is the resizable
style of interaction.
That's where you take your object and you drag it like this.
OK.
So if we're going to write a test for this and do these user interactions let me refresh
this page and analyze what happens to the HDMI out.
So if I come over here and select this object you guys can see that it looks like this.
And then if we take our navigation thing and hover over here we can see that there is a
handle that we can take and drag it.
Right.
And we already know that selenium web drive has a click and hold the method.
And so when we're manually doing this we're clicking and holding here.
And then we started dragging it.
And so we drag it and I let it go.
And Dan I hover over this again.
You guys can see that now.
This has a style attribute with a width and height because we've made it bigger.
So let me show you guys that again.
Look without being dragged and dropped it does not have a styli attribute but when it
gets dragged down when you look at it it has a style.
OK so if we were to do a drag and drop to a certain spot on this canvas then all we
would have to do is check that it has a style property and that would tell us that it has
been resized.
If you wanted to go ahead and check the actual values you can do that as well.
But for our purposes just to make sure that we actually resized that checking for style
property is enough.
And so let's go ahead and take a look at the code.
It's going to be very similar to what you guys have seen before.
I named the resizing example up here.
And the standard procedure we navigate to the trail we find the frame.
Now the one thing that you need to do here is find that resizable handle and when you
look at the H.T.
a mile of the resizable handle we can see the properties here and it does have a class
name which we can utilize here.
But as you guys know so many drivers are going to complain because of these spaces.
So we need to use X path and so using it looks bad.
This is this kind of an expression that you get again this tutorial on identifying elements
isn't the complete Millennium Wave drive of course.
Make sure you go and see those tutorials.
If you're confused about this.
We get really in-depth about XPath and all this kind of stuff and identification of elements.
But anyway so once we identify the handle now we're going to use our actions class to
click and hold on the handle.
Right.
And then we're going to do the move by offset the method and move by OFSAA just moves the
element a certain direction into the x and y coordinates.
So you guys can see here is the end.
So I just move that 100 pixels by 100 pixels and then I'm doing a perform.
And then finally I'm doing our assertion making sure our.
Let me take this expression.
If this ID with style exists and if it exists then our test has passed and the element has
been resized.
So let's take a look to see if Iran's going to come here and click on and you guys can
watch the test as it happens as well.
So you guys saw that right.
It resized and then our test passed successfully and we have successfully resized and Alamut.
So that's another cool technique that you guys can use.