-
Notifications
You must be signed in to change notification settings - Fork 2
How To ‐ Sauce Labs
NikolayStanoev edited this page Feb 22, 2017
·
3 revisions
- Create Sauce Labs account or use an existing one.
- Login in that account and get the following information - username / access_key. You can get this information from Sauce Labs User Settings
- Download Sauce Connect - this is a Sauce Labs executable which will make a tunnel between your machine and Sauce Labs environment. You can find more information for Sauce Connect (and download it) from here. Keep in mind that you will need different file to download depending on your OS from where you want to start Sauce Connect.
- Start Sauce Connect - you can simply run the following command from bin folder of the downloaded zip file (just replace username / access+key with your values):
sc -u username -k access_key
You can use the code below which will return BrowserStack url (just replace username / access_key with real values):
private String getSauceLabsHubUrl() {
String user = "username";
String key = "access_key";
return "https://"+user+":"+key+"@ondemand.saucelabs.com:443/wd/hub";
}
private DesiredCapabilities getSauceLabsiPhoneCapabilities(){
DesiredCapabilities capabilities = DesiredCapabilities.iphone();
capabilities.setCapability("appiumVersion", "1.6.3");
capabilities.setCapability("deviceName","iPhone 7 Simulator");
capabilities.setCapability("deviceOrientation", "portrait");
capabilities.setCapability("platformVersion","10.0");
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("browserName", "Safari");
return capabilities;
}
private DesiredCapabilities getSauceLabsAndroidCapabilities() {
DesiredCapabilities capabilities = new DesiredCapabilities().android();
capabilities.setCapability("appiumVersion", "1.5.3");
capabilities.setCapability("deviceName","Google Nexus 7C Emulator");
capabilities.setCapability("deviceOrientation", "portrait");
capabilities.setCapability("browserName", "Browser");
capabilities.setCapability("platformVersion", "4.4");
capabilities.setCapability("platformName","Android");
return capabilities;
}
- Sauce Labs documentation is really good and can give you a lot of insights about automated testing on mobile.
- Before decide using Sauce Labs as your primary option check the following things (Pricing / iOS & Android OS Supported Versions for automated testing / Mobile Browser Version).
- https://wiki.saucelabs.com/display/DOCS/The+Sauce+Labs+Cookbook+Home
- https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/
- https://wiki.saucelabs.com/display/DOCS/Supported+Android+Emulators
- https://wiki.saucelabs.com/display/DOCS/Requirements+for+Android+and+iOS+Mobile+Application+Testing
WIKI
How To - Local