---
title: Mobile Browser Testing with Selenium | TestingBot
description: Run Selenium tests against mobile Safari on real iPhones and iPads, and
  mobile Chrome on real Android devices. Appium-driven, W3C-compliant, with simulator
  and emulator support.
source_url:
  html: https://testingbot.com/support/web-automate/mobile
  md: https://testingbot.com/support/web-automate/mobile/index.md
---
# Mobile Browser Testing with Selenium

TestingBot lets you run Selenium WebDriver tests against **mobile Safari on iOS** (iPhone and iPad) and **mobile Chrome on Android** , on both [simulators/emulators](https://testingbot.com/support/web-automate/browsers) and [real physical devices](https://testingbot.com/support/app-automate/devices) in our EU data centre. Mobile sessions are routed through Appium automatically; no separate Appium install needed on your side.

Looking for native app testing instead of mobile browsers? See [App Automate](https://testingbot.com/support/app-automate) for Appium, XCUITest, Espresso and Maestro on real devices.

## Configuring capabilities

TestingBot's mobile simulators and emulators can be accessed using Appium. You can use the device picker below to select the capabilities you want to use for your tests.

  ![OS selected](https://testingbot.com/assets/environments/svg/ios-383468addf160fa18d0e431f529420739d7f7d1206175f682fead627d2e99a52.svg) iOS 18.6 › iPhone 16 

Loading environments...

Please wait while we load the available devices and platforms.

 W3C Protocol 
 W3C is the newest WebDriver protocol, TestingBot recommends using W3C. 

 JSONWP 
 JSONWP is the legacy protocol which is no longer actively maintained. 

JavaPythonNodeJSC#RubyPHP

    MutableCapabilities capabilities = new MutableCapabilities();
    capabilities.setCapability(CapabilityType.BROWSER_NAME, "safari");
    capabilities.setCapability(CapabilityType.BROWSER_VERSION, "18.6");
    capabilities.setCapability("appium:deviceName", "iPhone 16");
    capabilities.setCapability(CapabilityType.PLATFORM_NAME, "iOS");

You can configure more options by using the [Appium capabilities generator](https://testingbot.com/support/app-automate/appium/capabilities).

## Portrait/Landscape

It's possible to rotate the device before and during your test. Please see these examples:

**Set orientation before test (capability):**

    caps = {
      platformName: "iOS",
      "appium:deviceName": "iPhone 15",
      "appium:orientation": "LANDSCAPE" # or PORTRAIT
    }

**Rotate during test:**

    ((AppiumDriver) driver).rotate(ScreenOrientation.LANDSCAPE);

## Specifying Appium Version

TestingBot will use the most recent, compatible, Appium version according to the device, OS and version you specify.

If you'd like to specify your own Appium version, you can do this with the `appiumVersion` capability.

To learn more about the available Appium versions, please see our [Appium versions documentation](https://testingbot.com/support/app-automate/appium/appium-versions).

[Java](https://testingbot.com#)[NodeJS](https://testingbot.com#)[Python](https://testingbot.com#)[C#](https://testingbot.com#)[Ruby](https://testingbot.com#)[PHP](https://testingbot.com#)

Pass the `appiumVersion` capability inside `tb:options`. The examples below target an iPhone running mobile Safari, for Android Chrome change `platformName` to `"Android"`, `browserName` to `"chrome"`, and pick an Android `deviceName`.

    XCUITestOptions options = new XCUITestOptions();
    options.setPlatformName("iOS");
    options.setDeviceName("iPhone 16");
    options.setPlatformVersion("18.6");
    options.setBrowserName("safari");
    
    Map<String, Object> tbOptions = new HashMap<>();
    tbOptions.put("key", "API_KEY");
    tbOptions.put("secret", "API_SECRET");
    tbOptions.put("appiumVersion", "2.4.1");
    options.setCapability("tb:options", tbOptions);
    
    IOSDriver driver = new IOSDriver(
        new URL("https://hub.testingbot.com/wd/hub"), options);

    from appium import webdriver
    from appium.options.ios import XCUITestOptions
    
    options = XCUITestOptions()
    options.platform_name = "iOS"
    options.device_name = "iPhone 16"
    options.platform_version = "18.6"
    options.browser_name = "safari"
    options.set_capability("tb:options", {
        "key": "API_KEY",
        "secret": "API_SECRET",
        "appiumVersion": "2.4.1"
    })
    
    driver = webdriver.Remote("https://hub.testingbot.com/wd/hub", options=options)

    const { remote } = require('webdriverio');
    
    const driver = await remote({
      hostname: 'hub.testingbot.com',
      port: 443,
      protocol: 'https',
      path: '/wd/hub',
      user: 'API_KEY',
      key: 'API_SECRET',
      capabilities: {
        platformName: 'iOS',
        browserName: 'safari',
        'appium:deviceName': 'iPhone 16',
        'appium:platformVersion': '18.6',
        'tb:options': {
          appiumVersion: '2.4.1'
        }
      }
    });

    using OpenQA.Selenium.Appium;
    using OpenQA.Selenium.Appium.iOS;
    
    var options = new AppiumOptions();
    options.PlatformName = "iOS";
    options.BrowserName = "safari";
    options.AddAdditionalAppiumOption("deviceName", "iPhone 16");
    options.AddAdditionalAppiumOption("platformVersion", "18.6");
    options.AddAdditionalAppiumOption("tb:options", new Dictionary<string, object>
    {
        ["key"] = "API_KEY",
        ["secret"] = "API_SECRET",
        ["appiumVersion"] = "2.4.1"
    });
    
    var driver = new IOSDriver(
        new Uri("https://hub.testingbot.com/wd/hub"), options);

    require 'appium_lib'
    
    caps = {
      caps: {
        platformName: 'iOS',
        browserName: 'safari',
        'appium:deviceName': 'iPhone 16',
        'appium:platformVersion': '18.6',
        'tb:options' => {
          'appiumVersion' => '2.4.1'
        }
      },
      appium_lib: {
        server_url: 'https://API_KEY:API_SECRET@hub.testingbot.com/wd/hub'
      }
    }
    
    driver = Appium::Driver.new(caps).start_driver

    $capabilities = [
      'platformName' => 'iOS',
      'browserName' => 'safari',
      'appium:deviceName' => 'iPhone 16',
      'appium:platformVersion' => '18.6',
      'tb:options' => [
        'key' => 'API_KEY',
        'secret' => 'API_SECRET',
        'appiumVersion' => '2.4.1',
      ],
    ];
    
    $driver = RemoteWebDriver::create(
      'https://hub.testingbot.com/wd/hub',
      $capabilities
    );

## Testing internal or staging mobile sites

Use the [TestingBot Tunnel](https://testingbot.com/support/tunnel) to run mobile-browser tests against websites that aren't publicly reachable (local dev servers, staging environments behind a VPN, internal QA sites). Start the tunnel with an identifier, then pass `tunnelIdentifier` in your `tb:options` capabilities so the mobile device routes traffic through your tunnel.

See the [TestingBot Tunnel documentation](https://testingbot.com/support/tunnel) for setup details on Java, Docker and command-line installs.

## Next steps

- [Mobile browser & OS list](https://testingbot.com/support/web-automate/browsers) — current iOS/Android browsers available on the grid.
- [Real device list](https://testingbot.com/support/app-automate/devices) — physical iPhones, iPads and Android phones/tablets.
- [Appium capabilities reference](https://testingbot.com/support/app-automate/appium/capabilities) — full list of mobile capabilities supported.
- [Appium versions](https://testingbot.com/support/app-automate/appium/appium-versions) — pin a specific Appium release.
- [App Automate](https://testingbot.com/support/app-automate) — native mobile-app testing with Appium, XCUITest, Espresso and Maestro.
- [Real device testing overview](https://testingbot.com/real-device-testing) — how the real-device cloud works.

Was this page helpful? Yes No 

## Looking for More Help?

Have questions or need more information?   
 You can reach us via the following channels:

- [Email us](https://testingbot.com/contact/new)
- [Join our Slack Channel](https://join.slack.com/t/testingb0t/shared_invite/zt-3bcw9xch-jk19~6XPs_xBrsAgAedkCw)
