what up everyone welcome back to the channel and today we're going to be continuing the series
again so in the last video we saw how we can install appium inspector as well as set up the
desired capabilities and save them so we're just going to continue where we left off so
the reason why i said save the desired capabilities so i'm just going to close this
and if you go under the save capabilities sets
so we call it pixel full caps you can see it's already saved so if you want to close rpm and
restart it we all we have to do is come to our save capability sets and just click start session
all right so you can see that it fired up the contacts application so this is appium
inspector so what you can see is all the highlights we have all the elements
that are available we can collect these elements interact with these elements
and use it for our scripted so let's take a look to the top this is native app mode we have a web
hybrid app mode so maybe if you had of let's say a react native that maybe something would look a
little different um next we have select elements so this is what's going to highlight the elements
for us so i'm just going to put it back to the native app mode because that's what we're using
next we have tap by coordinates so anytime i move my cursor you can see in the top
in this area right here we have the coordinates so we can use this coordinates if we want to you know
select on a particular area so let's say we wanted to click right here we can set that it's actually
going to click it so you can see everything loaded it made the interaction on the emulator and it's
captured here as well so we're just going to click the cancel and everything is working nice so
we're going to take a look at this um so take off to tap like coordinates and go back by select
elements next we have back refresh so if you want to close let's say this page on the emulator if
see it didn't refresh automatically so what we can do is just hit the refresh button and it's going
to take a screenshot and capture that again for us next we have the start recorded with the starter
recording you're going to use the interactive tools here so whether tap send keys clear copy
well you're not going to use copy attributes and get timing so you're just going to use these three
so if you wanted to say click add account we can put our focus on this element and then do tap
so now we can see one our element is pulling up another page for us the google sign-in page and
next we can see the mobile element and how it's going to capture the element for us right now it's
written in java and junit so it has it defined so that's what we did it found lme using the id
so this is what it found the element using just this type of selector and
you can do this for others as well so if i hit the refresh we can see we are on this page so
right now i don't think i can interact with anything here but i can't interact with the
next so if i hit tab next you can see we have that element captured as well so that's a little bit
of the recording i'm just going to close that i'm just going to go back to the main app and go back
and come back to the main contacts page and let's rest refresh
and we're good there's also some other languages so we have jswd promise gs web driver
oxygen junit python ruby and the robot framework so if you're interested in using the record
function you can use that and we have search search for element so you can search for lm by id
so certain selectors you paste it in there and it would find it
so let's try that out so we go here we have this id let's copy it
and let's try moving our focus on something else let's say the book and if you do
search for element by id let's peace let's see what happens
so it did it brought back this let's see if we can tap the element
yep that worked it put us back into you know the google sign-in page so that definitely works so
you can definitely find elements used in that way it's not something that you typically do
so let's cancel next we have copy xml source to clipboard so if you want to copy everything
that's in here all this xml you can do that as well and you can just quit the session
and close the inspector so let me just put this back to the java j unit
all right so next i'm just going to open this up a little bit bigger
so sometimes you may have some elements let's refresh
so there we go i can interact with these elements so that's there we go
i thought we couldn't at first but just refreshing all the elements are clearly um being captured by
xpath all those you can search by text different attributes as well so element id the index where
the package is at what type of class so that's a type of a button um the text will get email
so different ways you can capture the element i'm just going to go back to the contacts page
and do a quick refresh and it's going to bring us here so what we're going to do
is just simply create a new contact so in order to do that we need to
interact with this button so right now it's not finding that button and that's that's good this
is a good example on using your xml app source to find elements that are not being in focus
so right now i cannot focus on this floating button so if i take a look into my app source
let's try to get a little bigger so you can see i'm just going to open this up
there we go so i'm just going to scroll what you typically do you would need to just open
make sure you can open up all the arrows it's going to tell you where you're at so
what we're looking for is the floating so here it is somehow it's this little blue
blue rectangle but this is the element we need to interact with the floating action button and to
know that we're interacting with it we can hit the tab button and this should take us to a new page
so here we are we have a create a new contact so we can interact with
each of these elements as well with the cancel button you have to create new contact title save
right now i'm just going to enter my name into a dummy text phone number and click
save i'm just gonna show you that we can either record it and just save that as well
or we can just
to close the record you can click close to open it back up
here we go so i hit the clear actions and i'm just going to hit um type my first name
type my last name type the phone number and then click save i'm just going to record that
so first thing is first i'm going to click this element we're going to use the tap
now we have the focus of the curses and the first name now we want to send the key so we can use
this button next i'm going to type jamal
hit the send keys so now we see the first name is entered so now we're going to go
to the last name element we selected it it's in focus now we have to tap that
now you can put the cursor in focus you see it in focus over here
and now we're going to do send keys and we're going to do richard
hit the send keys and now we have our last name and the last thing we're going to do
is the phone so we have that in focus hit tab and we're going to do send keys
so we can do 1 2 3 two three four five five five nine eight seven six
don't call me so now we can see we have the number inserted as well and what we want to do is simply
just click the save button so we're going to put that in focus and we're going to click the tap
all right it looks a little weird here that means a screenshot capture before it fully loaded all
we have to do is just hit the refresh button and everything should look good so now i have a new
contact myself Jahmal everything is in here so that's pretty much how you can get familiar with
rpm and appium inspector um some could take this code we can input this code into java
and run the script via that i will do another video showing how you can use java to interact
with appium and run it as a script we may do this same test case and just do it in java
um if you guys found this video helpful definitely smash the like button subscribe to the channel
if you have any questions feel free to drop a comment reach out to me and i'll do my best to
respond as quickly as i can so thank you guys for watching i'll see you guys in another video
you