Testing Your Site with Mac OS, iOS, and Android

Sauce AI for Test Authoring: Move from intent to execution in minutes.|xBack to ResourcesBlogPosted

February 12, 2026 · 5 min read · Mobile Testing

Sauce AI for Test Authoring: Move from intent to execution in minutes.

|

x

Back to Resources

Blog

Posted August 24, 2012

Testing Your Site with Mac OS, iOS, and Android

quote
screen-shot-2012-08-13-at-11.16.17-am-300x223

Here at Sauce Labs, we & # x27; re always looking frontward to the next big thing in quiz. That & # x27; s why we & # x27; re proud to denote support for Mac OS X, iOS, and Android! If you & # x27; re a developer and designing site for mobile devices, it is increasingly important to test those sites on a nomadic twist. Now, you can run tests on iOS and Android in Sauce & # x27; s automated and manual examination instrument. To get started running tests on OS X, exactly modify the tests you already have. Our cloud supports the most mutual browser, so running tests in OS X is as easy as alter your Selenium 1 browser objective or Selenium 2 desired capability to use OS X. Here & # x27; s a mere example for Selenium 1:

from selenium import selenium
import unittest

class sauce (unittest.TestCase):
def setUp (self):
self.browser = selenium (
& # x27; ondemand.saucelabs.com & # x27;,
80,
& quot; & quot; & quot; {& quot; username & quot;: USERNAME,
& quot; access-key & quot;: ACCESS_KEY,
& quot; os & quot;: & quot; Mac 10.6 & quot;,
& quot; browser & quot;: & quot; firefox & quot;,
& quot; browser-version & quot;: & quot; 3.6 & quot;,
& quot; name & quot;: & quot; Testing Selenium 1 in Python at Sauce & quot;
} & quot; & quot; & quot;,
& # x27; http: //saucelabs.com & # x27;)
self.browser.start ()

def test_sauce (self):
browser = self.browser
browser.open (& quot; /test/guinea-pig & quot;)

And hither & # x27; s an example using WebDriver:

import unittest
from selenium importee webdriver

class Selenium2OnSauce (unittest.TestCase):

def setUp (self):
desired_capabilities = webdriver.DesiredCapabilities.FIREFOX
desired_capabilities [& # x27; browser & # x27;] = & # x27; firefox & # x27;
desired_capabilities [& # x27; version & # x27;] = & # x27; 8 & # x27;
desired_capabilities [& # x27; platform & # x27;] = & # x27; Mac 10.6 & # x27;
desired_capabilities [& # x27; name & # x27;] = & # x27; Testing Selenium 2 in Python at Sauce & # x27;

self.driver = webdriver.Remote (
desired_capabilities=desired_capabilities,
command_executor= & quot; http: //USERNAME: ACCESS_KEY @ ondemand.saucelabs.com:80/wd/hub & quot;
)

def test_sauce (self):
self.driver.get (& # x27; http: //saucelabs.com/test/guinea-pig & # x27;)

Using OS X in our manual examination creature is as leisurely as selecting & # x27; Mac OS & # x27; and your best-loved browser.

Nomadic Testing in Sauce

screen-shot-2012-08-13-at-2.00.17-pm-300x148

The most exciting feature we are launching is support for iOS and Android in our cloud. Using iOS and Android in our manual testing tool follows the same process as any other browser, so let & # x27; s focus on running automated tests in iOS and Android. Before bunk tests in the iOS simulator or Android aper, make certain you are employ Selenium WebDriver for your Selenium testing. Running tests on iOS is about the like as any early browser, with two caveats. First, the iOS simulator run inside OS X so you & # x27; ll need to make certain to specify & # x27; Mac 10.6 & # x27; as the platform. Secondly, you will need to take an orientation for test to run in (portrait or landscape). We support both iPhone and iPad. Here & # x27; s an example for iOS:

Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script.

import unittest
from selenium import webdriver

class Selenium2OnSauce (unittest.TestCase):

def frame-up (self):
desired_capabilities = webdriver.DesiredCapabilities.IPHONE
desired_capabilities [& # x27; browser & # x27;] = & # x27; iphone & # x27;
desired_capabilities [& # x27; version & # x27;] = & # x27; 4.3 & # x27;
desired_capabilities [& # x27; platform & # x27;] = & # x27; Mac 10.6 & # x27;
desired_capabilities [& # x27; name & # x27;] = & # x27; Testing Selenium 2 on iOS! & # x27;
desired_capabilities [& # x27; deviceOrientation & # x27;] = & # x27; portrait & # x27;

self.driver = webdriver.Remote (
desired_capabilities=desired_capabilities,
command_executor= & quot; http: //USERNAME: ACCESS_KEY @ ondemand.saucelabs.com:80/wd/hub & quot;
)

def test_sauce (self):
self.driver.get (& # x27; http: //www.saucelabs.com/ & # x27;)

That & # x27; s all there is to it! If you & # x27; d rather run your tests on ipad, just switch out iphone and ipad like so:

desired_capabilities = webdriver.DesiredCapabilities.IPAD
desired_capabilities [& # x27; browser & # x27;] = & # x27; ipad & # x27;

And you can run tests with landscape devices too! Just use the & # x27; deviceOrientation & # x27; potentiality:

desired_capabilities [& # x27; deviceOrientation & # x27;] = & # x27; landscape & # x27;

So what about Android? The process is very like to iOS, except the & # x27; platform & # x27; should be & # x27; linux & # x27; instead of & # x27; Mac 10.6 & # x27;; of course you & # x27; ll use & # x27; android & # x27; instead of & # x27; iphone & # x27; or & # x27; ipad & # x27; where appropriate:

desired_capabilities = webdriver.DesiredCapabilities.ANDROID
desired_capabilities [& # x27; browser & # x27;] = & # x27; android & # x27;
desired_capabilities [& # x27; variant & # x27;] = & # x27; 4 & # x27;
desired_capabilities [& # x27; platform & # x27;] = & # x27; linux & # x27;
desired_capabilities [& # x27; name & # x27;] = & # x27; Testing Selenium 2 on Android! & # x27;
desired_capabilities [& # x27; deviceOrientation & # x27;] = & # x27; portrait & # x27;

Android uses a special capability called & # x27; deviceType & # x27;. You can set it to & # x27; phone & # x27; or & # x27; tablet & # x27; like so:

desired_capabilities [& # x27; deviceType & # x27;] = & # x27; tablet & # x27;

That & # x27; s it! If you & # x27; ve follow along to this point, congratulations, you & # x27; ve run your 1st tests on Android, iOS and Mac in the Sauce cloud! If you want to see iOS and Android in action, check out our screencast.

Felicitous Testing!

Published:
Aug 24, 2012
Share this post
Copy Share Link
LinkedIn
© 2026 Sauce Labs Inc., all rights reserved. SAUCE and SAUCE LABS are file trademarks owned by Sauce Labs Inc. in the United States, EU, and may be registered in other jurisdictions.
robot
quote

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free