Reuse browser Selenium tests for ios app


A project I’m on is developing a web app at the same time as an ios app (for the same thing) and I’m hoping to be able to use existing Selenium tests, but we’re having trouble with selectors. Is there a selector type or attribute name that can be used for both Selenium Webdriver and Appium ios, so that I can just set a variable to either browser or app and they run and work on both. Nobody on this project has used Appium before, so we are lacking a lot in knowledge.

I tried using IDs and found that ios doesn’t work with them, changed to names and found that names have been removed from appium. If possible we’d prefer to use a selector that will be the same in the browser as it is in the app.


Well, mobile native apps and web apps are quite different. Only a subset of the selectors that are available for browser Selenium tests are available for Appium tests. The selectors that are available are also interpreted differently than they are on Selenium tests. My advice is to build a separate test suite for the native application.

Being able to drop in an existing Selenium browser test and witnessing it work on an Appium test (even with a bit of tweaking to the locators) should be seen as a rare occurrence.

I am seeing IDs used within the iOS tutorial for Appium located here:

Switch to WEB_VIEW context, and run your tests for browser