📺 Develpreneur YouTube Episode

Video + transcript

Mobile Testing With Test Project - Part 3

2022-02-17 •Youtube

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]
so it gives us
two files here we have a demo android
app and a generate utils
so the generated utils
is just our keys this is how it loads
any predefined data that you may have
exported with your project
since we didn't have any we don't have
any of those files so this utility is
there but not really used
then we have our demo android app
this is the meat of everything
if you look it looks just like a
selenium project or a
test ng or unit test project with
selenium so we have to set up our driver
we execute we get our driver we tear
down
once we're finished we provide the
parameters which is where that utility
file comes in and then we get the
browser capabilities so they have a git
capabilities method so we can actually
if this was a browser we would do our
browser configuration there
since this is android
we do the same thing we set up the
different emulators things so we say oh
our platform is android what is our
emulator
since we're not really doing a browser
we leave the browser name blank but here
we have to actually set the package name
and activities
this looks very similar if you go back
to any of the selenium classes i've
talked about for testing
this looks just like a test ng project
but it's happy so we have our display
name demo android
setup so here's our android key
it's registered to me
we do our execute so we pass in the
provided parameters
we get our results so we set that start
the results as false and they get
defined as true at the end
so we have our pause times
we have driver ready app and so on now i
will try to run this i had some issues
with this before
because i don't quite have appium
configured correctly on my machine yet
but we will give this oral so we'll try
to run this as a unit test
still trying to load
only recently was i able to get android
running on my mac i have the new m1 mac
so
they just came out with the latest api
build so we can actually run the
emulators now on this device
and the problem i'm running into now is
appium isn't quite configured right on
my device to actually interact from code
to the
emulators so i still have to work on
that
but that's it so here's your code you
can make changes to this you can then
load this to any continuous integration
project you want like jkins bamboo
and run your emulators and you should be
good to go
we have any questions
hey there michael i was just a little
curious on uh you probably covered this
and i just missed it in the meeting or
missed the meeting um you know you
selenium versus uh test ng versus test
project
i'm sure they just have their strengths
and weaknesses which one do you prefer
maybe they're covering different use
cases for you
okay so you're looking for the
differences between test project test ng
selenium uh
and like this selenium id the different
flavors for testing
okay
so
first of all test project is
definitely more heavily geared towards
like manual ui emulator driven testing
that's pretty much what test project is
you basically you go in there you set up
your tests then you can kick off your
tests and run them all through their
emulators through their containers
with that being said they've added the
coding piece so you can now run offline
and export everything so now you have
that more continuous integration type
model that you could do with your types
of testing
with appium it's pretty neat now if you
export their web tests
they actually export the web test using
junit and selenium webdriver so you
really can't get away from selenium
webdriver if you're trying to run things
from code
however with that being said the
selenium ide tool
to me
is inferior to what test project
provides
because test project actually gives you
that self-healing that ai feature so
that is huge when it comes from a
testing perspective when you're trying
to record scripts
because
your apps are changing you know
a lot of times when you're testing stuff
it's in flux it's still being developed
so
what you run into is oh your test works
today the one they do to deploy tomorrow
it breaks now you have to go in and you
have to troubleshoot find the new id
uh find the new button whatever
well with selenium id you're gonna have
to go do all that manually you're gonna
have to walk through the steps see where
it fails fix it by either re-recording
it or fixing the ids
with test project you just run the test
if it identifies something changes it
will give you that little pop-up and
give you the option to select a
new way of looking it up like new xpath
new id new button new component
and then you save your test and you're
done so that from the
record and playback perspective test
project is hands down
the best tool i've seen yet
from a continuous integration option
what if you're doing mobile testing
when you export your code
everything they do they export to june
which is fine except junit
is a little limited on some of the
things that you can do as far as
it's
its primary role is unit testing
whereas test ng allows you to do a lot
of your like regression testing your
integration testing like you can
actually start doing the different
layers of testing from test ng you can
you just have to set it up and configure
it so tess ng is more robust as far as a
testing framework
from a coding perspective so anything
you export from test project to code
i would recommend once you get working
as junit port it into test ng and then
set it up for more continuous
integration more robust testing
regression testing and then deploy to
something like jenkins or bamboo
does that answer your question yes sir
yes sir and actually added some nuance
to it i
was
thinking um to myself i'm not sure if
you can hear me let's take it to myself
around the um um
was it clicking click and recording such
but you
you added the nuance that selenium is
going to allow you to then take that to
code and do the continuous uh
integration and delivery so
really nice really nice appreciate the
answer great
yeah and definitely and
that's kind of what i've learned in the
last seven eight years of doing this
with testing i mean i've looked at
almost every tool out there
there's still a handful i'm not overly
familiar with
like i have messed around with cucumber
and well it's useful i think it is
completely bloated with the allowed uh
with what it is required to do all the
setup and your
struts and stubs that you have to do to
actually get to the point where you
write your tests
where
the selenium framework that i've been
kind of showing that i've kind of
built up over time it eliminates most of
that that's what that test generator
tool is that i have
but with that said there's other things
out there like protractor
you know um you got
other unit tests uh and plugins now for
visual code so there are other things
out there
but still a lot of them are in their
infancy so be careful with that it's
like test project when i first looked at
it when it was version one
it was interesting i like the concept
and i like the ideas but at its time it
was very inferior to what it is today
uh what it is today if you take test
project and you take like i want to say
it's catalin
which is the
test gui tool open source tool you can
download and record your tests that i've
shown in the past
not catalan which is uh i i get these
confused because they're so closely
named not the google
language but the test tool uh it's
either catalan or kettle on
and that is like an eclipse type tool
that is record playback it gives you a
little bit more code you can kind of
structure it a little bit more there
and build out your test cases and kind
of a little bit more
along the lines of like what soap ui did
but from more of a record playback kind
of perspective so they actually embed
what it looks like the selenium ide
within their test tool well that's all
fun and games and all great it still
requires a lot of user interaction with
the
interface to get
to basically build your test to run your
tests to manage your tests
where if you export it to a good test
framework in code it's very quickly if
you separate those layers
if you do it right
like i've shown where if you separate
all your test logic to a test
portion of your framework and all the
basically the uh interfacing with the
application for testing to the other
part of the framework now the two can
work in parallel so you can go tweak
the framework to work with the
application as changes happen without
impacting the tests and you can continue
to write tests without needing to worry
about the framework you just use the
framework um the integration points as
you need them
so
it's kind of a best of both worlds but
it depends on your environment if you're
dealing with a small
like a very small mobile app or very
small web app you don't need to go to
that extreme just use a record playback
tool do a few things get get up and
running and be done
but if you have a larger test suite you
know with maybe like 10 15 20 customers
you have maybe five six seven
integration points within your
application you may have data sets that
you need to test then yes definitely go
from the simpler testing to a more
advanced framework like test ng
selenium or you know whatever flavor you
need for your testing
stuff good stuff appreciate that
good question thank you anyone else
okay hearing none
i'd like to thank everyone for their
time today if you'd like to discuss any
of these topics further you can reach us
on
info at developernerd.com
we also have a contact us page on
developernerd.com
you can find our videos on youtube just
google developer nerd and we also have
our videos on vimeo at vimeo.com
developer nerd we also have podcasts on
most podcasts
applications like spotify
ipod on mac just check us out
search for developer our goal is making
every developer better have a great day
you
Transcript Segments
0.48

[Music]

26.8

so it gives us

28.48

two files here we have a demo android

31.599

app and a generate utils

35.2

so the generated utils

37.28

is just our keys this is how it loads

40.32

any predefined data that you may have

42

exported with your project

43.76

since we didn't have any we don't have

45.52

any of those files so this utility is

48.64

there but not really used

50.96

then we have our demo android app

53.199

this is the meat of everything

55.76

if you look it looks just like a

58.32

selenium project or a

60.879

test ng or unit test project with

64.239

selenium so we have to set up our driver

66.56

we execute we get our driver we tear

69.439

down

70.24

once we're finished we provide the

72.32

parameters which is where that utility

74.72

file comes in and then we get the

76.72

browser capabilities so they have a git

78.479

capabilities method so we can actually

80.479

if this was a browser we would do our

82.88

browser configuration there

84.799

since this is android

87.119

we do the same thing we set up the

88.96

different emulators things so we say oh

90.799

our platform is android what is our

93.119

emulator

94.56

since we're not really doing a browser

96.159

we leave the browser name blank but here

98.24

we have to actually set the package name

100.079

and activities

102.079

this looks very similar if you go back

104

to any of the selenium classes i've

106.079

talked about for testing

107.84

this looks just like a test ng project

112.72

but it's happy so we have our display

115.04

name demo android

117.6

setup so here's our android key

120.32

it's registered to me

123.28

we do our execute so we pass in the

125.92

provided parameters

129.28

we get our results so we set that start

131.52

the results as false and they get

133.84

defined as true at the end

136.239

so we have our pause times

139.28

we have driver ready app and so on now i

143.599

will try to run this i had some issues

145.44

with this before

147.68

because i don't quite have appium

149.28

configured correctly on my machine yet

151.76

but we will give this oral so we'll try

154.08

to run this as a unit test

156.8

still trying to load

159.68

only recently was i able to get android

162.879

running on my mac i have the new m1 mac

166.48

so

168.16

they just came out with the latest api

170.56

build so we can actually run the

171.84

emulators now on this device

174.64

and the problem i'm running into now is

176.879

appium isn't quite configured right on

179.599

my device to actually interact from code

182.48

to the

183.519

emulators so i still have to work on

185.2

that

186.56

but that's it so here's your code you

188.56

can make changes to this you can then

190.319

load this to any continuous integration

192.72

project you want like jkins bamboo

195.36

and run your emulators and you should be

198.08

good to go

200

we have any questions

202

hey there michael i was just a little

203.76

curious on uh you probably covered this

206

and i just missed it in the meeting or

208.4

missed the meeting um you know you

210.4

selenium versus uh test ng versus test

213.76

project

214.799

i'm sure they just have their strengths

216.56

and weaknesses which one do you prefer

219.519

maybe they're covering different use

220.959

cases for you

224.159

okay so you're looking for the

227.44

differences between test project test ng

230.959

selenium uh

232.72

and like this selenium id the different

235.28

flavors for testing

237.68

okay

238.56

so

239.439

first of all test project is

242.319

definitely more heavily geared towards

245.84

like manual ui emulator driven testing

249.92

that's pretty much what test project is

251.76

you basically you go in there you set up

253.68

your tests then you can kick off your

255.36

tests and run them all through their

257.6

emulators through their containers

260.56

with that being said they've added the

263.36

coding piece so you can now run offline

265.52

and export everything so now you have

267.199

that more continuous integration type

269.44

model that you could do with your types

271.68

of testing

273.36

with appium it's pretty neat now if you

276.479

export their web tests

278.96

they actually export the web test using

281.919

junit and selenium webdriver so you

284.72

really can't get away from selenium

286.4

webdriver if you're trying to run things

287.919

from code

289.68

however with that being said the

291.199

selenium ide tool

293.759

to me

294.72

is inferior to what test project

296.8

provides

298.24

because test project actually gives you

300.16

that self-healing that ai feature so

302.72

that is huge when it comes from a

305.039

testing perspective when you're trying

306.4

to record scripts

308.32

because

309.36

your apps are changing you know

312

a lot of times when you're testing stuff

313.68

it's in flux it's still being developed

315.84

so

316.72

what you run into is oh your test works

318.88

today the one they do to deploy tomorrow

321.039

it breaks now you have to go in and you

323.12

have to troubleshoot find the new id

325.68

uh find the new button whatever

328.72

well with selenium id you're gonna have

330.479

to go do all that manually you're gonna

332

have to walk through the steps see where

333.52

it fails fix it by either re-recording

336.08

it or fixing the ids

338.72

with test project you just run the test

342

if it identifies something changes it

344.24

will give you that little pop-up and

346.24

give you the option to select a

348.479

new way of looking it up like new xpath

350.56

new id new button new component

353.68

and then you save your test and you're

355.36

done so that from the

358

record and playback perspective test

359.6

project is hands down

361.28

the best tool i've seen yet

363.52

from a continuous integration option

367.199

what if you're doing mobile testing

369.52

when you export your code

371.6

everything they do they export to june

373.919

which is fine except junit

376.96

is a little limited on some of the

379.28

things that you can do as far as

382.72

it's

383.52

its primary role is unit testing

386.319

whereas test ng allows you to do a lot

389.84

of your like regression testing your

391.52

integration testing like you can

392.88

actually start doing the different

394.24

layers of testing from test ng you can

396.16

you just have to set it up and configure

397.84

it so tess ng is more robust as far as a

401.919

testing framework

403.52

from a coding perspective so anything

406.08

you export from test project to code

408.8

i would recommend once you get working

411.52

as junit port it into test ng and then

414.96

set it up for more continuous

416.319

integration more robust testing

418.639

regression testing and then deploy to

420.639

something like jenkins or bamboo

424.24

does that answer your question yes sir

426.639

yes sir and actually added some nuance

428.4

to it i

429.759

was

430.72

thinking um to myself i'm not sure if

433.12

you can hear me let's take it to myself

435.199

around the um um

438.319

was it clicking click and recording such

441.44

but you

442.479

you added the nuance that selenium is

444.479

going to allow you to then take that to

446.08

code and do the continuous uh

448.16

integration and delivery so

450.479

really nice really nice appreciate the

452

answer great

453.44

yeah and definitely and

455.68

that's kind of what i've learned in the

457.52

last seven eight years of doing this

459.52

with testing i mean i've looked at

461.52

almost every tool out there

463.68

there's still a handful i'm not overly

466.319

familiar with

467.759

like i have messed around with cucumber

470.319

and well it's useful i think it is

472.56

completely bloated with the allowed uh

475.039

with what it is required to do all the

477.52

setup and your

479.599

struts and stubs that you have to do to

481.28

actually get to the point where you

482.8

write your tests

484.8

where

486

the selenium framework that i've been

488.08

kind of showing that i've kind of

490

built up over time it eliminates most of

492.4

that that's what that test generator

493.84

tool is that i have

496.479

but with that said there's other things

498.08

out there like protractor

499.759

you know um you got

501.84

other unit tests uh and plugins now for

504.639

visual code so there are other things

506.24

out there

507.199

but still a lot of them are in their

509.44

infancy so be careful with that it's

511.599

like test project when i first looked at

513.2

it when it was version one

515.44

it was interesting i like the concept

518.399

and i like the ideas but at its time it

521.279

was very inferior to what it is today

524.24

uh what it is today if you take test

526.959

project and you take like i want to say

529.12

it's catalin

530.88

which is the

532.56

test gui tool open source tool you can

535.279

download and record your tests that i've

537.519

shown in the past

538.88

not catalan which is uh i i get these

542.16

confused because they're so closely

543.519

named not the google

545.44

language but the test tool uh it's

547.839

either catalan or kettle on

549.92

and that is like an eclipse type tool

552.48

that is record playback it gives you a

554.959

little bit more code you can kind of

556.48

structure it a little bit more there

558.72

and build out your test cases and kind

560.88

of a little bit more

562.64

along the lines of like what soap ui did

564.72

but from more of a record playback kind

567.2

of perspective so they actually embed

569.12

what it looks like the selenium ide

571.279

within their test tool well that's all

573.76

fun and games and all great it still

576.399

requires a lot of user interaction with

579.44

the

580.24

interface to get

582

to basically build your test to run your

583.6

tests to manage your tests

585.76

where if you export it to a good test

588.72

framework in code it's very quickly if

591.36

you separate those layers

593.12

if you do it right

594.72

like i've shown where if you separate

597.12

all your test logic to a test

599.519

portion of your framework and all the

602.64

basically the uh interfacing with the

605.04

application for testing to the other

606.72

part of the framework now the two can

609.04

work in parallel so you can go tweak

611.92

the framework to work with the

613.44

application as changes happen without

615.6

impacting the tests and you can continue

617.76

to write tests without needing to worry

619.839

about the framework you just use the

621.76

framework um the integration points as

624.64

you need them

626

so

627.68

it's kind of a best of both worlds but

629.68

it depends on your environment if you're

631.44

dealing with a small

633.92

like a very small mobile app or very

635.6

small web app you don't need to go to

637.44

that extreme just use a record playback

639.519

tool do a few things get get up and

642.16

running and be done

643.6

but if you have a larger test suite you

645.68

know with maybe like 10 15 20 customers

648.56

you have maybe five six seven

650.32

integration points within your

651.6

application you may have data sets that

654.32

you need to test then yes definitely go

656.88

from the simpler testing to a more

658.959

advanced framework like test ng

661.279

selenium or you know whatever flavor you

663.36

need for your testing

666.72

stuff good stuff appreciate that

669.6

good question thank you anyone else

672.72

okay hearing none

675.36

i'd like to thank everyone for their

676.88

time today if you'd like to discuss any

679.2

of these topics further you can reach us

681.279

on

682.079

info at developernerd.com

684.399

we also have a contact us page on

687.12

developernerd.com

689.12

you can find our videos on youtube just

691.44

google developer nerd and we also have

694.079

our videos on vimeo at vimeo.com

697.44

developer nerd we also have podcasts on

700.399

most podcasts

702.24

applications like spotify

704.56

ipod on mac just check us out

708

search for developer our goal is making

710.48

every developer better have a great day

729.839

you