So now I want to teach you guys something extremely cool and extremely useful that I've
found in my career doing automated software testing especially on the goofy style elements
is opening up the Network tab.
You guys know how in all of the browsers there is a developer tools will be utilized to locate
our elements.
Well it can get further than that.
There are multiple other tabs that are extremely helpful when it comes to debugging and I've
found that the Network tab is one of the most useful ones because if you're designing some
kind of a test and your application is really slow to load sometimes it's helpful to see
the Network tab to see why the application is really slow to load and then that way if
your application is you know taking 10 20 seconds to load for some reason.
In fact I think more than five it's crazy.
But if it's taking a really long time to load you can locate in the networks to see which
call is taking an extremely long time to happen.
And then you can report that to your developers and you can continue to expand this even better
because if you're running in a cloud based service like browsers stack or Soss lives
where your videos are being recorded of every single test run when it's time for you to
debug why test failed you just go in and watch the video and see the network time to figure
out what's going on and why your application is being extremely slow.
And that may help in the debugging process for the developers.
Really I've caught numerous bugs and numerous problems because I had the Network tab open
using my browsers.
So it's been very helpful.
So not only am I going to teach you guys that but also along the way we're going to kill
two birds with one stone and you guys are going to learn how to do some key down and
key up actions and how to send keys using user interactions.
So it kind of kills two birds with one stone you not only learn how to open network type
you also learn how to do a few other actions using user interactions.
Now here is where flakiness can come in and you guys need to be really careful because
commands for different kinds of browsers are usually different.
So for example to do open up the Network tab with Firefox all I had to do was Google how
to open the Network tab with keyboard shortcut keys on Firefox and I got this page.
I'm going to put this in our notes and you guys can see that if I want to open a network
monitor using Firefox the command for Windows is different than the command for always sucks
and it is different than the command for Linux.
So you guys need to be mindful of that and you probably need to start setting up some
kind of logic to be handling different kinds of browsers.
If it's one browser you do control shift.
Q If it's over sex to do command opt.
Q So that's where the flakiness with user interactions can command.
But if you handle it appropriately you will be OK.
So let me show you if I hear it control shift Q Right now on my Firefox you guys can see
how it opened up the network tab.
And there are many other tabs here available.
But I found the networks have to be the most useful.
And if I refresh it you guys can see how in the Network tab we see every single call that
is occurring from the CML page which again I like I said is going to be very useful for
you and I found it very useful in my career.
So that translated in code is actually pretty simple.
Here I am navigating to Google dot com for hours just to open up a page and then we're
using again the actions class to do key down and there is this class called keys that allows
you to pick which key you want to send.
So for example control shift cues what we want to perform right.
So if you do Keys dot control you guys see that it's all in here.
The key is class has all of the kids that you need to do like add all air down air left
there all right.
You know won through 12 help home number pad page down subtract all of these kids are there
for you to utilize.
So it makes it very simple to passing the keys
that you want.
And so I'm changing I'm pressing the key down on the control then I'm pressing a key down
on the shift and then I'm not pressing a key down on the cue because that's not allowed.
I am sending keys to the cue which is the keyboard.
And then I am performing that action.
And afterwords right now you imagine Slaney and web driver has the keys pressed down you
need to make sure that you release those keys.
Otherwise you'll get weird behavior because control shift is still pressed down and so
you're always pressing it down as you're doing the rest of your actions.
So immediately after performing you need to release.
And so here we're doing a Chiappe.
I'm releasing the keys control and keys that shift again and then I'm performing that I'm
letting them go.
And then we're navigating to that slow page with the probable example just to see the
network traffic.
Let's go ahead and give the sovereign just to see what that looks like.