What will you learn in this lecture?
In this video, we will learn about the RemoteWebDriver in Sauce Labs. In the previous tutorial, we went learned about the overview of the solution.
RemoteWebDriver
So if you scroll down a bit in this file you will see that I have an end unit setup method instead of the send unit setup method. I create a driver and that driver is created using a webdriver factory that’s an implementation that I created. You don’t have to worry about it. What’s important for you is this method right here.Create sauce driver.
I’m going to go ahead and go inside of this method and show you what it does. Now of course if you want to copy over this webdriver implementation for yourself webdriver factory implementation for yourself feel free to do so. But what you really want is this method. The reason I have a Webdriver factory is because I’ve been reusing the same drivers all over my solution so I need a single place where these Web drivers are created.
But anyways inside of here the very first thing that I want you to pay attention to is now rather than using a specific driver like chrome driver Firefox driver safari driver or something like that. We are actually going to use a remote Web driver a remote webpage driver if we take a look at it. Is it’s actually an implementation of iWeb a driver. So what that means to you is that everything that your Chrome driver safari driver used to be able to do the remote Web driver will be able to do as well. Check it out you can see how there are all the fine the by methods there are the fine by fine elements methods here.
You can do stuff like get screenshots and manage and navigate all that sort of stuff which makes sense right. If you’re simply switching from a local chrome driver to a remote Web driver you should be able to do all the same things and your test should function flawlessly and they do. And so that’s the remote Webdriver that we’re going to be using.
As you can see also the remold Web driver has multiple constructors that you can utilize in order to return yourself a remote driver. So this is how we’re going to use the remote Webdriver which we’re going to need to do is passing a new URI object with this exact URL right here. This will tell the remold Webdriver to run the tests on the sauce labs cloud along with that.
We’re going to pass in a capabilities object which I’ll talk about more in a second and then we’ll pass a time span the time span is actually a command timeout. Letting the remote Webdriver know after how long do you want a command to fail. So for example, if your test doesn’t see a command for a in this in this instance 600 seconds then I want you to shut down the session and fail. So that’s the time span that we’re passing in.
I like 10 minutes because sometimes you may actually be inside of sauce labs debugging and stepping through code and so then you wanted this time span set to 10 minutes so that you can debug and play with stuff around and not have to worry about the session timing out on you because it hasn’t seen a command for 10 minutes.
[Tweet “Learn how to create a RemoteWebDriver in Sauce Labs?”]
Next Tutorial
In the next tutorial, you will learn about the overview of the solution.
What will you learn in this course?
This course is an introduction to Sauce Labs with Selenium webdriver.
Taught by Nikolay Advolodin, CEO of ultimateqa.wpmudev.host. 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.
Take This Entire Course for Free
[Tweet “Learn everything you need to know about Sauce Labs with Selenium Webdriver.”]