Site icon TestingDocs.com

SauceLabs Cloud Testing

Overview

SauceLabs is a cloud testing platform that enables us to test the web and mobile applications with devices on the cloud. Integration with SauceLabs allows us to perform continuous automated cloud testing, cross-browser testing, parallel testing on multiple devices, and live interactive manual testing. To know more about the platform please visit the official website: https://saucelabs.com/

 

Free Trial

 

 

Sign-up for the service

 

 

Running a Web Test

https://www.testingdocs.com/saucelabs-running-an-example-sample-test/

 

Running an Appium Mobile Test

package com.testingdocs.appium.quickstart.AppiumProject;

import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import io.appium.java_client.android.AndroidDriver;

/**
 * Sample Sauce Labs Test.
 */
public class AppTest{
  public static final String USERNAME = "<your_username>";
  public static final String ACCESS_KEY = "<your_key>";
  public static final String URL = "https://"+USERNAME+":" + ACCESS_KEY + "@ondemand.us-west-1.saucelabs.com:443/wd/hub";
  public static AndroidDriver<?> mDriver;

  @BeforeTest
  public void setup( ) throws MalformedURLException {
    DesiredCapabilities caps = DesiredCapabilities.android();
    caps.setCapability("appiumVersion", "1.9.1");
    caps.setCapability("deviceName","Samsung Galaxy S9 Plus HD GoogleAPI Emulator");
    caps.setCapability("deviceOrientation", "portrait");
    caps.setCapability("browserName", "Chrome");
    caps.setCapability("platformVersion", "8.1");
    caps.setCapability("platformName","Android");
    mDriver = new AndroidDriver<>(new URL(URL), caps);
  }

  @Test
  public static void titleTest(){
    mDriver.get("https://www.testingdocs.com/");
    Assert.assertEquals(mDriver.getTitle(), "Home | TestingDocs", "Check Title");
  }

  @AfterTest
  public void tearDown( ){
    mDriver.quit();
  }
}

 

Configure the username and access key. Run the test.

View the result.

1 -> JSON API calls

 

Exit mobile version