Search code examples
androidiosmobileappium

Generic mobile tests with appium


I'm new to mobile testing , and currently I research for an automation framework for mobile testing. I've started to look into Appium, and created some tests for the demo app I've made (one for IOS and the other for Android). I've managed to write a test for each of the platforms , but I was wondering , how difficult it might be to write a one generic test which will be executed on the both platforms with minimum adjustments ?

Thanks


Solution

  • It is possible but you have to keep same labels for each component for all platforms, for example to click on a button, instead of locating through Xpath locate by its name.

    WebElement button = driver.findElement(By.name("my button")); button.click();

    More info finding elements in Appium docs: http://appium.wikia.com/wiki/Finding_Elements