Documentation, tips, tricks for migrating from Selendroid to UIAutomator or UIAutomator2

I’m about to try to migrate a Appium 1.6.5 + Java-based codeline that has been running with Selendroid for many years. Are there any documents or guidelines that demonstrate best practices for changing locator strategies (what are the proper org.openqa.selenium.By strategies? I’m also looking for tips on inspecting elements to determine proper locators (what are the preferred tools).

Thanks in advance

1 Like

Our team completed the migration to UIAutomator2 and compiled these guidelines for converting our Java Element libraries:

You can use any of these locator strategies:

  •“toolbar_title”) or“”)
  • By.xpath("//android.widget.RelativeLayout[@content-desc=‘Now Playing’]")
  • MobileBy.xpath("//android.widget.TextView[@resource-id=‘’]")
  • MobileBy.AccessibilityId(“Play”) or“play”)

These locator strategies won’t work:

  • By.linkText, MobileBy.linkText or By.partialLinkText
  • xpaths with @value or @id attributes

Replacement strategies:

1 Like