Hey so in this video I want to show you why sauce labs is great and why you need
it and the advantages that it has but before I tell you why you need sauce
labs and why you should use the product I need to explain you a little bit about
how it works that will help you to understand all of its advantages and
disadvantages the way sauce labs works is you're gonna have your source code so
this will be our source code file RCS files right and so our source core
code files will be executed by what's known as a selenium hub so this will be
a hub this is basically a server that takes the source code and decides where
an automated test will be executed and what I mean by that is a hub can have
multiple different nodes so for example it may have a node that goes out to here
and a node will be another this will be a virtual machine it could be a virtual
machine or now the invention of doctor it could be containers or it could be a
local machine but that would be problematic as you'll see in the future
so let's call it a virtual machine right now until you guys learn how to use
docker so virtual machine and this virtual machine can be configured to run
on a browser which will be our browser will be Firefox and then the operating
system can be let's say windows we could have another node again this is another
VM that can be configured to run on say Safari and then the OS can be Mac
and you can have many different nodes like this
these are all nodes you can have many different nodes and so a your tests can
be getting passed to the hub and the hub will determine on which node the test
should run you actually specify you can specify that in your file you can do
something like um use something like an AB dot configure or you can use
something like a configuration file for the hub I believe it's a JSON format
that you can use to configure the hub and so all you can even do it in the
source code itself this is all for configuration
nodes and so you can do all of that through these configuration files and
then the hub will determine where you want the automated test to run so that
is how a selenium grid works the problem with this is that first you the
automation engineer are the one that has to maintain it so what that means is
that you have to maintain the hub and you have to maintain all of the nodes so
that brings problems of maintenance
you're gonna have to maintain the operating system you're gonna have to do
patching you're gonna have to update arm the virus software you're gonna have to
update browsers and you're gonna have to do all of that if you're gonna maintain
your own nodes however with sauce labs they make it much easier because sauce
labs what they would do is basically sauce labs would replace your hub this
will be a sauce labs hub which lives in the cloud and so rather than you
pointing at your own hub you're gonna run in a sauce labs hub and then they're
gonna maintain all of the VMS for you here they're gonna have multiple they
have hundreds of possible node combinations which are all going to be
different kinds of virtual machines that you can run on that get spin spun up a
real-time live for every single test execution that you want and so with that
said you can see that there are multiple advantages of sauce labs first they're
going to drastically decrease your maintenance time
because you don't have to maintain your all own selenium grid this will reduce
bylaw you'll probably be saving 50% of your time on maintenance if you if you
have a very good selenium grid you're probably spending all of your time
maintaining that selenium grid it can actually be a full-time job to maintain
that selenium grid and so the end of the day what do you want to do you want to
be automating functional tests or automating any kind of tests or
maintaining a selenium grid what is your job really at the end of the day I would
argue that it's the former so with all of that there's another advantage is
that they provide you cross-browser testing capability you can do cross
browser automation during the cross browser automation is amazing because
they have hundreds of virtual machines that are configured you can run an
Android you can run in Linux you can run on Mac you can run on tablets you can
run on mobile emulators you can even run on the real mobile devices so there are
hundreds if not thousands of combinations of all the knows and you
can run on there's no way that you will ever be able to set up your own selenium
grid to handle all of that not without a giant team also with that
automatically whenever you get your sauce labs license you'll get cross
browser manual testing it's just an extra bonus that I just wanted to
mention because what it basically allows you to do is pull up your application in
any kind of configuration that you want to see instead of running an automated
test all you have to do is pull up your browser and your browser operating
system combination and you can view your website on that OS combination and that
will allow you to you know the cross browser manual testing see how that
looks there's another fourth benefit that's
hidden from all of this is that sauce labs help
to make debugging way easier how does it do that
well it's actually pretty fantastic whenever you're gonna run your automated
test that's gonna go to the sauce labs hub right it's gonna run through the
remote driver sauce labs provides you automatic screenshots they provide you
automatic videos and they provide you automatic logs I'll show you that later
as you'll see but it's fantastic because the automatic videos themselves are
already a phenomenal way to debug your automated testing sessions they just you
don't have to do anything literally nothing you don't have to change your
source code at all all you do is just run your test and you'll get all of that
out of the box and the final advantage that I wanted to talk about of sauce
labs was that it decreases the amount of time to run your full suite of tests
well and so how does it do that well sauce labs honestly any selenium grid
can do that but sauce labs can do it as well allows you to run tests in parallel
so rather than running one test at a time what you can do is have multiple
tests feeding in here into the hub at the same time and then the multiple
tests can all run on the multiple browsers and operating systems at the
same time you purchase based on parallelization ability the license the
costs based on parallelization that's how it cost so if you want to run on two
VMs that's cheaper than running on five VMs at the same time but imagine that if
you have five vm's that you can run on at the same time that's that much faster
that you can you execute you automate a test right if you have for example let's
say ten tasks and each one takes approximately one minute to run if
you're running those sequentially there's gonna be a total of ten minutes
right which is a ten minutes is that excellent time to run tests we have
thousands of tests so thousands of minutes for test execution not
acceptable at all shouldn't be acceptable for you either because that's
way too long of a feedback loop however if you have ten tests that can run on
let's say five MS that means you can run five tests at a time at one minute your
total test time so it's going to be two minutes because you're gonna have ten
tests
running on five VMs two iterations that you're going to need to do and it's
going to take two minutes long it actually will take longer than that it's
not a one-to-one ratio I'll talk about that in a little bit which actually
brings me to my disadvantages of salsa as with everything there are
disadvantages unfortunately