Selenium for Mobile Testing

Run Selenium tests on Real Mobile Devices on the Cloud. Test your websites on the latest mobile devices.

Optimizely runs 15,000+ tests in 45 minutes after moving to BrowserStack’s cloud-based infrastructure. Talk to our Experts about scaling up your tests today.

Benefits

Trusted by more than 25,000 customers globally

  • JQuery uses BrowserStack Open Source
  • Twitter uses BrowserStack
  • Harvard University uses BrowserStack
  • Expedia uses BrowserStack
  • Wikimedia uses BrowserStack

Frequently Asked Questions

Can Selenium be used for mobile testing?

Yes, Selenium can be used in combination with Appium for automating website tests on iOS devices. 

Testing websites on real iOS devices helps teams identify any bugs that an end-user might encounter in the real world. This ensures that apps and websites are thoroughly tested and can provide a flawless user experience.

Can I run both automated mobile browser tests and mobile app tests on BrowserStack?

Yes, BrowserStack’s real device cloud allows individual QAs and teams to run automated tests on mobile browsers as well as mobile apps on real Android and iOS devices. However, different tools are required for testing apps and websites. 

For testing websites, one needs to use automated Selenium testing on real mobile devices. For mobile app testing, use automated app testing with Appium.

How to use Selenium for testing on Real Mobile Devices?

As mentioned earlier, Appium can be used in combination with Selenium WebDriver as it uses the same WebDriver API. Thus, for developers or QAs with prior test experience in WebDriver, it is easy enough to use Appium for mobile testing using Selenium scripts. 

Refer to this Selenium documentation to get started with automated testing on real iOS or Android devices on BrowserStack.

How does the Selenium mobile testing architecture work?

As mentioned earlier, Selenium is used in combination with the Appium server to drive browser automation tests on mobile devices. At a high level:

  • The Appium server uses the JSON wire protocol to accept test commands from the Client in the form of an HTTP restful request.
  • Based on the Desired Capabilities configured, the Appium server executes these commands on specific mobile platforms using native automation drivers (For e.g. XCUITest for iOS, and UI Automator for Android).

Is Selenium different from Appium?

Yes. Selenium is used to automate web browsers. It is primarily used for cross-browser testing of web applications. Appium, on the other hand, is mainly used for automating tests for native, hybrid, and mobile web apps on mobile devices. In particular, Appium is a highly preferred framework because it supports automation for both iOS and Android operating systems.

Why is Selenium preferred for mobile testing?

Selenium is a widely used tool for automating web-browsers. Its intuitive API and compatibility with multiple client libraries make cross-browser testing very easy for teams.

Appium derives its roots from Selenium and uses the same WebDriver API for driving mobile browsers on Android and iOS. Thus, Appium makes mobile testing using Selenium WebDriver easier for teams or individuals who have prior experience working with Selenium. 

Why is BrowserStack the preferred choice for developers and QAs?

BrowserStack’s Cloud Selenium Grid empowers teams with the ability to conduct parallel testing on desired mobile devices (Android or iOS) and browsers. Once a developer or a QA signs up on BrowserStack, they can instantly start testing on a variety of desired mobile-browser combinations.

Additionally, BrowserStack also provides integrations with popular frameworks like Appium, Selenium, XCUITest, Espresso. This ensures that testers have a comprehensive mobile testing experience on the platform.