Automation Testing

How to Run a Selenium Test in SauceLabs

By Test Guild
  • Share:
Join the Guild for FREE

In this video, I'm going to show you how easy it is to get started using Sauce Labs and to run your first Selenium test on Sauce.

For those of you that don't know, SauceLabs is the exclusive sponsor of my TestTalks podcast. Accordingly, I have a special code that you can use to get 20 hours of free automation! Check out my SauceLabs page for more info.

SauceLabs is great because they allow you to focus on testing instead of worrying about maintaining a bunch of environments against which your tests need to run. To get a small taste of this sauceomeness, let's take a look at what it takes to get a Selenium script running in the SauceLabs Cloud.

Getting Started with Sauce Labs

First, log on to SauceLabs with your free account. (Check out my video on how to use my special SauceLabs promo offer.)

Under the Tools section, select the Getting Started button.

You'll be presented with three options:

  • Automated
  • Mobile
  • Manual

Select Automated


Now all you need to do is follow this quick, four-step process:


  • Choose your language.

For this example I'll be using Java, but SauceLabs supports all the Selenium language bindings.

  • Next, set up your Project.

The easiest way to get up and running is to use the sample SauceLabs project, then modify it to get your tests started. I'm using Maven and JUnit, so I'm going to copy the JUnit Maven option to create my sample project.


  • Open up a command line, paste the above code and hit Enter.


  • Maven should automatically create the SauceLabs sample project for you.


  • Next, open up your IDE and import the SauceLabs sample project.
  • Once the project is imported, open up the SampleSauceTest.java file. It contains everything you need to get started. Sauce also did a great job of documenting each line of code to help you understand how everything works.
  • For this example, I'm going to delete their Amazon test and add two of my own tests that will run against my Selenium sample test page.


  • Once you've modified, it's time to run. From your IDE, select the Maven run command.
  • Once the tests are done running, log on to SauceLabs to view the results.

What's really cool is that once your test is done running you'll have a bunch of option like screenshots, video and logs to help you check your results.


Why Sauce Labs is Awesome

When you run your test in Sauce, there's no setup on your part, and you won't have to waste time digging through never-ending log files. When your tests are done you'll get your results automatically — along with video and screenshots — so you'll know exactly what to fix if your test fails!

You can also run your tests against over 485 different combinations. Think about how much time this will save you. I work for a large company and I would normally have to request a new VM for each different configuration. Next, I would have to install and maintain all these environments. Then I'd have to go to our Continuous Integration group and pray that they would have the time to set the test up to run.

With SauceLabs, I can bypass all that and focus on what I love to do — creating automated tests.

Checkout Sauce Labs yourself by using my promo code testtalks14 and get 20 hours of automated testing for free!

  1. Thanks for that Joe. Have you ever used BrowserStack? I find that it’s kind of unstable and they have a lot of issues on their end. Do you have the same issue with Sauce Labs?

  2. Pingback: Sauce Labs C#

Comments are closed.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Leveraging AI and Playwright for Test Case Generation

Posted on 11/22/2024

Two BIG trends the past few years in the software testing space been ...

Symbolic AI vs. Gen AI: The Dynamic Duo in Test Automation

Posted on 09/23/2024

You've probably been having conversations lately about whether to use AI for testing. ...

8 Special Ops Principles for Automation Testing

Posted on 08/01/2024

I recently had a conversation, with Alex “ZAP” Chernyak about his journey to ...

Sponsor The Industry-Standard E2E Automation Testing Annual Online Event (Limited Spots Left) - Reach Out Now >>