What will you learn in this lecture?
In this video, we will go through the different advantages of running automated tests using Sauce Labs. In the previous tutorial, we went through the syllabus of the course to familiarize yourself with the topics being taught.
Advantages of Sauce Labs
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 how it works that will help you to understand all of its advantages and disadvantages.
The way Sauce Labs works is you gonna have your source code. So this will be our source code file. So our source code files will be executed by what’s known as 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 that a hub has multiple nodes. So for example, it may have a node that goes out here and node would be another, this will be another virtual machine. It could be a virtual machine or now the invention of DOM it could be containers or it could be a local machine. But that will be problematic because you can see it in the future so let’s call it a virtual machine right now until you guys learn how to use docker.
So this virtual machine can be configured to run on a browser which will be a browser will be Firefox and 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 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 your task can be getting past to the hub and the hub will determine which node the test should run. You can specify that in your file. You can do something like an app.config or you can use something like a configuration file for the hub.
I believe that JSON format that you can use to configure the hub. And so all you can do the source code itself. This is all for configuration nodes.
And so you can do all of that through this configuration files and then the hub will determine where you want the automated tests 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 that means that you have to maintain the hub and you have to maintain all of the nodes. So that brings problems of the maintenance.
You gonna have to maintain the operating system. You gonna have to do patching. You gonna have to update the virus software. You gonna have to update browsers and you gonna have to do all of that if you 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 would be a Sauce labs hub which lives in the cloud and so rather than you pointing at your hub, you gonna run in a sauce lab hub and they gonna maintain all the VMs for you. Here they gonna have multiple, they gonna multiple, they gonna have hundreds of possible node combinations which all are gonna be different kinds of virtual machines that you can run on. The JS spint, span of real-time rife for every single test execution that you want.
And so would that said, you can see that there are multiple advantages of Sauce Labs.
First, they going to drastically decrease your maintenance time because you don’t have to maintain your all Selenium grid. This will be reduced by a lot. You probably are saving 50% of your time on maintenance. If you have a very good selenium grid you probably spending all of your time maintaining that Selenium grid. Actually, that will be a full-time job to maintain that Selenium grid.
And so at the end of the day what do you want to do you’re gonna be automating functional tests or automating any kind of tests or maintaining Selenium grid. What is your job really attend the day. I would argue that it’s the former.
So with all of that, there’s another advantage. It’s that they provide you cross-browser testing capability.
You can do cross-browser automation. Doing cross-browser automation is amazing because they have hundreds of virtual machines that are configured. You can run on Android. You can run on Linux. You can run on mac. You can run on tablets. You can run mobile emulators. You can even run on real mobile devices.
So there are hundreds if not thousands of combinations of all the nodes that you can run on. There’s no way that you are ever 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 get cross-browser manual testing.
It’s just an extra bonus that I just want to mention because what this like 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 need to do is pull up your browser and your browser operating combination. And you can review your website on that OS combination and that will allow you to the cross-browser manual testing to see how that looks.
There’s another fourth advantage that is hidden from all of these. It’s that Sauce Labs helps to make the debugging way easier.
How does it do that?
Well, it’s actually pretty fantastic.
Whenever you gonna run your automated tests, this gonna go to the Sauce Labs hub. It gonna run through the remote driver. Sauce Labs provide you automatic screenshots. They provide you automatic videos and they provide you automatic logs. I show you that later as you 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 want to talk about Sauce Labs was that it decreases the amount of time to run your full-speeded tests.
How does it do that? Well, Sauce Labs allows you to run tests in parallel. So rather than running one test at a time, which you can do is that you have multiple tests feeding in here into the hub at the same time. And then the multiple tests can all run on multiple browsers and operating systems at the same time.
You purchased based on parallelization ability. The license costs based on parallelization that’s how it costs. So if you gonna run 2 VMs, that’s cheaper than running 5 VM’s at the same time.
But imagine that if you have 5 VMs that you can run at the same time, that’s much faster than you can execute your automated tests. For example, if you have 10 tests and each one takes approximately 1 minute to run. If you are running those sequentially that’s gonna be a total of 10 minutes which is an excellent time to run tests.
We have thousands of tests so thousands of minutes are not acceptable at all.
However, if we have 10 tests that we can run on let’s say 5 VMs that means you can run 5 tests at a time at 1 minute. Your total test time is gonna be 2 minutes because you have 10 tests running on 5 VMs.
Two reiterations that you gonna need to do and it’s gonna take 2 minutes long. It actually takes longer than that. It’s not a 1 to 1 ratio.
I’ll talk about that in a little bit which it actually brings me to my disadvantages of Sauce Labs. In everything, there are disadvantages, unfortunately.
[Tweet “There are certain advantages of Sauce Labs. Check this out!”]
In the next tutorial, you will learn about the disadvantages (yes there are some) of running automated tests using Sauce Labs.
What will you learn in this course?
This course is an introduction to Sauce Labs with Selenium webdriver.
Taught by Nikolay Advolodin, CEO of www.ultimateqa.com. He had been teaching test automation for 5 years and is the author of top rated online courses to 50,000 students in over 100 countries around the globe.
In this course from Ultimate QA, you will learn:
– Why Sauce Labs is an amazing test automation tool.
– Overview of Sauce Labs.
– Sauce Labs advantages and disadvantages.
– How to analyze results.
– How to perform live debugging.
At the end of the course, you will take a final quiz along with the answers to the quiz questions for better understanding.
[Tweet “Learn everything you need to know about Sauce Labs with Selenium Webdriver.”]