Detailed Notes
Welcome, if you are a tester or developer interested in mobile application automation testing or are new to test automation tools than you defiantly need to check out TestProject. However, if you are not familiar with this tool that's OK. In Mobile Testing With Test Project we cover all the basics necessary to start mobile testing in Test Project 2.0.
TestProject is a community driven tool and has a free forever plan that is fully featured and that you can get started with in moments. In addition they have a lot of documentation that will help you with all the details you need to use TestProject to create effective test automation that your whole team can use.
Before you begin you will need to:
First, go back to the previous video on Test Project A Review of Version 2.0 and watch the section on setup. In addition, you will need to start the Test Project Agent so that Test Project can record against you local simulators and mobile devices. However, depending on your mobile device will determine what you will need to install and set up next. At this point, you will need Android Studio for Android development, Xcode / iOS Simulator for iOS, or both if you are going to be testing on both types of devices. Finally, if you plan on running your mobile tests out side of test project in a then you will need to export your tests to code. As a result you will need to have an IDE like Eclipse and run them using Appium
Transcript Text
[Music] okay let's go back over to monitor our apps ran we can look at the last execution we can go look at the reports and here's our reports okay so my android test my last test ran and all the steps passed however if we look at ios we come in here so everything ran and passed so it was able to self-repair and it was able to execute look at our agents so we have our one agent running i have that running up here if we have a problem with it or it hangs we can restart it that does happen sometimes but not a lot we can check to see what agents are in a ready state we can see what agents are in a disconnected state talk about integrations we won't really get into that much today so let's create a new test let's do new test let's do mobile next and this will be demo android or if you want to make these things as descriptive as possible but for demoing purposes i'm just being keeping it short and simple go next we'll do android select your mobile application so we have our choices put it all together sample drawer sample drawer one or we can add a new application so these are all previous applications that i've loaded so let's add a new application for testing so if you have a physical device attached you can click from device or if you have an emulator you can pick the emulator and then it takes in a moment to scan the device but then you can select the applications on the device so you can actually test like the browser like we just did with safari so here we could do maybe chrome see if this works if you don't want to load it from the device you can upload it from an apk file which is what i did for the react native project that we did i exported that to an apk and uploaded it or we can add it manually so we could actually load it from code we're going to keep this very simple today we're just going to try to kick off chrome let's click done and so we got chrome android all looks good next let's record a test now like i said last time we have the options to record to the cloud or save our test as a file we'll keep things simple and just use cloud for now and start the recording so as soon as you click start recording you get your step recorded here on the left and it tries to open up the emulator on the right and this will take a second or two to load and if you'll notice we're simulating what's going on in the actual emulator reset the application so it's reset we're back to this page so the first thing we notice is that we're recording now so we've cleared the application data and the app is now up for testing so we can come down here and click accept and continue and it recorded our click so we clicked accept and continue this was an android widget button we're going to skip the sync section so we click no thanks and it catches that as well now we're on the google page let's go in here and search for amazon it's thinking about something type amazon search why did we lose oh there we go okay so the test api found a better way to locate your elements during the recording so instead of us just typing it recognize that oh it's an edit text widget so we're going to search on a web address using the edit text instead of doing a search box text so now we're doing an xpath lookup to find the widget edit text and search or type web address so we click confirm and we find amazon and then we look for this guy here so we click amazon and now we're on the amazon google search so if we want to scroll you have to click and drag up to get your arrow to kind of see how far you want to scroll so and there's amazon.com so we want to click on that and say we want to search for donuts okay so we got donuts and it gives us coffee which is just fine all right so we've added 13 steps so let's pause this and let's rerun and make sure everything works so it resets the app and we essentially go through and click through our steps including our mistakes it's thinking because we're trying to find amazon.com yep see self 10 was self healing so now it's trying to go back so it looks like it clicked or it didn't scroll far enough so now it's going to kind of scroll up and down the page to find the right search results still thinking but the nice part is it's smart enough to determine this so well you may have to do this once or twice to get your test defined correctly once it's defined it should be good to go so for some reason you start running your test and things break you can always reload your tests if you're running them offline in test project and they should work now let's go ahead and stop that so here we go again test ai found a better way to locate your elements so it did not like the view for amazon.com so it found oh well we need to do an xpath lookup and this makes more sense because it was a google search so this could change so it needs to do an xpath lookup to find it all right so we can save and exit we now have our demo app we can run it we can select our agent now if i run it from this screen and run it i have to actually go out to the emulator to see it running so if you actually have your device connected this is just a quick and easy way to run the test on your app without having to go into the monitor go and do the screen sharing and just test it and it's going to have to think about because the donuts is slightly different this time but that is how we create a android app all right so next let's walk through adding an ios app so let's go to mobile next and this is going to be a demo ios next ios so now you have the options of adding a new application for testing so we have amazon expo safari so i've already pre-loaded these if you have the developer license you can load the ipa but because i do not it will not let me run this so i have to actually add a new application so we can again upload the ipa we can run from code or we can run from device so if i do iphone 13 oh i can then look on the device because the emulator is running right here so it will give me a list of all the devices that are available so i have contacts right here i have files i have health maps mobile calendar and so on so let's try maps we've read this before this could go completely bad but let's give it a shot so let's do maps record keep it default cloud start recording so we want to select our device and like i said before when the emulators are running it's the last device in the list and we click select i always takes a little bit longer to load and pretty much every time you start a new test you for mobile you almost always want to clear and restart that way you're always starting with the fresh emulator so hit yes and that will ensure the first step gets saved right so now we're recording so we'll click continue to take the default when we want our settings we'll say you don't allow and let's search maps thinking so when you try to click something if you can't find it initially it will do its logic to find the step so we found it all right let's search for nashville tennessee there we go nashville tennessee and let's go to guides and let's look for things to do oh look there's an actual site so we can click the site and open up tennessee tourism so this now should open up let's say a browser it's trying to figure out what this element is might not be clickable it might be clicking on the wrong thing apparently that's not clickable so close that and see up here it's thinking all right so uh maybe we want to do things to do there we go things to do uh nashville's best photoshop for photo spots okay we can then click a location zoom in on it and you have to be patient when you're recording these for the first time because the application does have to think through what it's trying to do mobile is a little bit more difficult than web so just gonna be a little smarter and then there's the ramen all right so let's save this so let's stop let's run it actually let's slow this down just a little bit so we can see what's going on let's run so as you can see it has to kind of think through what it's doing because again the first time it's running this problem with the step again ah so if you notice that welcome page is not there for that first step i had to do so i did not need to do [Music] that again [Music] click maps open maps like step 2 still that was that preference page that loaded the first time let's run it again so now to restart and just go click the map section now now it has to think for me because we move things around and as you can see it can be temperamental but that one nashville just one more time just now we'll move on after this there it goes as you can see it's not perfect but with a little tweaking and just a little thinking through the test the first time or as you work through your development cycles and you have to tweak this you will have to make some adjustments to your test steps but most of the time the test project agent should be able to rectify what it's trying to do i'm going to go ahead and stop this and exit all right so we have our demo android we have our demo ios so the last thing i want to show you today is how to export this code and look at it inside of eclipse so if we take our project here demo android you have a couple different options you can do with this project you can move it to a folder you can share this test with someone else and let them run it it's another beautiful feature of test project is the sharing you can get a direct link you can change parameters you can copy the id but what we want is this section down here we want to generate the code so we want to click back and then you have your options of java c-sharp python and then you have test project legacy or test project open sdk i recommend sticking with the test project open sdk give it your project name so this will be io test project generate my first project we'll say my first android project i think i already have my first project out there lowercase and then we'll download this allow okay code is downloaded so let's go find our code so go to downloads i'm going to copy this to my development folder let's go to development okay i have appium here's my code export this open this guy up okay so there's my project and let's go look at this from eclipse okay now we want to import our project project from the folders next directory there's our project click open finish there's our project you notice there's no pom file so the first thing we need to do is we need to right click and we need to configure this to be maven or we can even do mobile nature but i want to get the dependencies so we'll take maven on take the defaults okay so if we go back to our slide we need these dependencies so we'll go out to our maven repository let's search for our dependencies for selenium java take the latest we'll add the dependencies section okay there's our selenium we then need java client for appium there's appium try to stay away from betas try to stick with the latest version here and last we need our test project there's live java sdks we'll search for by test project there we go and we'll take the latest release downloaded the dependencies so now our project compiles you
Transcript Segments
[Music]
okay let's go back over to monitor our
apps ran we can look at the last
execution
we can go look at the reports
and here's our reports okay so my
android test my last test ran
and all the steps passed
however if we look at ios
we come in here so everything
ran and passed so it was able to
self-repair and it was able to execute
look at our agents so we have our
one agent running i have that running up
here
if we have a problem with it or it hangs
we can restart it that does happen
sometimes but not a lot
we can check to see what agents are in a
ready state we can see what agents are
in a disconnected state
talk about integrations
we won't really get into that much today
so let's create a new test let's do new
test let's do mobile
next
and this will be demo
android
or if you want to make these things as
descriptive as possible but for demoing
purposes i'm just being
keeping it short and simple
go next
we'll do android
select your mobile application
so we have our choices put it all
together sample drawer sample drawer one
or
we can add a new application so these
are all previous applications that i've
loaded
so let's add a new application for
testing
so if you have a physical device
attached you can click from device
or if you have an emulator you can pick
the emulator
and then it takes in a moment to scan
the device but then you can select the
applications on the device
so you can actually test like the
browser like we just did with safari so
here we could do maybe chrome see if
this works
if you don't want to load it from the
device you can upload it from an apk
file which is what i did for the react
native project that we did i exported
that to an apk and uploaded it or we can
add it manually so we could actually
load it from code
we're going to keep this very simple
today we're just going to try to kick
off chrome let's click done
and so we got chrome android all looks
good next
let's record a test
now like i said last time we have the
options to record to the cloud or save
our test as a file we'll keep things
simple and just use cloud for now
and start the recording
so as soon as you click start recording
you get your step recorded here on the
left and it tries to open up the
emulator on the right
and this will take a second or two to
load
and if you'll notice we're simulating
what's going on in the actual emulator
reset the application
so it's reset we're back to this page
so the first thing we notice is that
we're recording now
so we've cleared the application data
and the app is now up for testing so we
can come down here and click accept and
continue
and it recorded our click so we clicked
accept and continue this was an android
widget button
we're going to skip the sync section so
we click no thanks
and it catches that as well
now we're on the google page
let's go in here and search for
amazon
it's thinking about something type
amazon search why did we lose oh there
we go okay
so the test api found a better way to
locate your elements during the
recording
so instead of us just typing it
recognize that oh it's an edit text
widget
so we're going to search on a web
address
using the edit text instead of doing a
search box text
so now we're doing an xpath lookup to
find the widget edit text and search or
type web address so we click confirm
and we find amazon and then we look for
this guy here
so we click amazon
and now we're on the amazon google
search
so if we want to scroll
you have to click and drag up
to get your arrow to kind of see how far
you want to scroll so
and there's amazon.com so we want to
click on that
and say we want to search for donuts
okay so we got donuts
and it gives us coffee which is
just fine
all right so we've added 13 steps so
let's pause this
and let's rerun and make sure everything
works so it resets the app
and we essentially go through and click
through our steps
including our mistakes
it's thinking because we're trying to
find amazon.com
yep see self 10 was self healing
so now it's trying to go back
so it looks like it clicked
or it didn't scroll far enough so now
it's going to kind of scroll up and down
the page to find the right search
results
still thinking
but the nice part is it's smart enough
to determine this
so well you may have to do this once or
twice to get your test defined correctly
once it's defined it should be good to
go
so for some reason you start running
your test and things break you can
always reload your tests if you're
running them offline in test project and
they should work
now let's go ahead and stop that
so here we go again
test ai found a better way to locate
your elements so it did not like the
view for amazon.com so it found oh well
we need to do an xpath lookup
and this makes more sense
because it was a google search so this
could change so it needs to do an xpath
lookup to find it
all right so we can save and exit
we now have our demo app we can run it
we can select our agent
now if i run it from this screen
and run it i have to actually go out to
the emulator to see it running so if you
actually have your device connected this
is just a quick and easy way to run the
test on your app without having to go
into the monitor
go and do the screen sharing
and just test it
and it's going to have to think about
because the donuts is slightly different
this time
but that is how we create a android app
all right so next let's walk through
adding an ios app so let's go to mobile
next
and this is going to be a demo
ios
next
ios
so now you have the options of adding a
new application for testing
so we have amazon expo safari so i've
already pre-loaded these
if you have the developer license you
can load the ipa
but because i do not it will not let me
run this so i have to actually add a new
application
so we can again upload the ipa we can
run from code or we can run from device
so if i do iphone 13
oh
i can then look on the device because
the emulator is running
right here so it will give me a list of
all the devices that are available so i
have contacts
right here i have files i have health
maps
mobile calendar and so on so let's try
maps
we've read this before this could go
completely bad but let's give it a shot
so let's do maps
record
keep it default cloud start recording
so we want to select our device and like
i said before when the emulators are
running it's the last device in the list
and we click select
i always takes a little bit longer to
load
and pretty much every time you start a
new test you for mobile you almost
always want to clear and restart
that way you're always starting with the
fresh emulator
so hit yes and that will
ensure the first step gets saved
right so now we're recording
so we'll click continue to take the
default
when we want our settings
we'll say you don't allow
and let's search
maps thinking
so when you try to click something if
you can't find it initially it will
do its logic to find the step so we
found it
all right let's search for
nashville tennessee
there we go nashville tennessee
and let's go to guides
and let's look for
things to do
oh look there's an actual
site so we can click the site
and open up tennessee tourism
so this now should open up
let's say a browser
it's trying to figure out what this
element is
might not be clickable it might be
clicking on the wrong thing
apparently that's not clickable so close
that
and see up here it's thinking
all right so uh maybe we want to do
things to do
there we go
things to do
uh nashville's best photoshop
for photo spots
okay we can then
click
a location
zoom in on it
and you have to be patient when you're
recording these for the first time
because the application does have to
think through what it's trying to do
mobile is a little bit more difficult
than web so
just gonna be a little smarter and then
there's the ramen
all right so let's save this so let's
stop let's run it
actually let's
slow this down just a little bit so we
can see what's going on
let's run
so as you can see it has to
kind of think through what it's doing
because again the first time it's
running this
problem with the
step
again
ah
so if you notice that
welcome page is not there for that first
step i had to do
so i did not need to do
[Music]
that
again
[Music]
click maps open maps
like step 2 still
that was that preference page that
loaded the first time
let's run it again
so now to restart
and just go click the map section now
now it has to think for me because we
move things around
and as you can see it can be
temperamental
but
that one
nashville
just one more time
just now we'll move on after this
there it
goes as you can see it's not perfect
but with a little tweaking and just a
little thinking through the test the
first time
or as you work through your development
cycles and you have to tweak this
you will have to make some adjustments
to your test steps but most of the time
the test project agent should be able to
rectify what it's trying to do
i'm going to go ahead and stop this
and exit
all right so we have our demo android we
have our demo ios
so the last thing i want to show you
today is how to export this code and
look at it inside of eclipse so if we
take our project here
demo android
you have a couple different options you
can do with this project you can move it
to a folder you can share this test with
someone else and let them run it
it's another beautiful feature of test
project is the sharing you can get a
direct link
you can change parameters you can copy
the id
but what we want is this section down
here we want to generate the code
so we want to click back and then you
have your options of java c-sharp python
and then you have test project legacy or
test project open sdk i recommend
sticking with the test project open sdk
give it your project name so this will
be io test project generate my first
project we'll say my first
android project i think i already have
my first project out there
lowercase and then we'll download this
allow
okay code is downloaded so let's go find
our code
so go to downloads
i'm going to copy this to my development
folder
let's go to development
okay i have appium
here's my code
export this
open this guy up
okay so there's my project
and let's go
look at this
from eclipse
okay now we want to import our project
project from the folders next
directory
there's our project click open
finish
there's our project
you notice there's no pom file so the
first thing we need to do is we need to
right click
and we need to
configure this to be maven
or we can even do mobile nature but i
want to get the dependencies so we'll
take maven
on take the defaults
okay so if we go back to our slide
we need these dependencies so we'll go
out to our maven
repository
let's search for our
dependencies for selenium java
take the latest
we'll add the dependencies section
okay there's our selenium
we then need java client for appium
there's appium
try to stay away from betas
try to stick with the latest version
here
and last we need our
test project
there's live java sdks we'll search for
by test project
there we go
and we'll take the latest release
downloaded the dependencies so now our
project compiles
you