Appium locators : how to identify

Like selenium WebDriver, we have AndroidDriver (extends AppiumDriver) for android mobile appiumlocatorsautomation.

Appium locators are quite similar to selenium locators

Prerequisites:

Let’s see all the locators one by one…

  • findElementByName

byname

When we click on the objects (digits), right side we can observe different locator values such as index, text, resource-id, class or content-desc etc…

text” value can represented as “name

  • findElementByAccessibilityId

respurceid

content-desc” is represented as “findElementByAccessibilityId”

  • findElementById

“resource-id” is represented as “findElementId”

  • findElementByXPath

  • findElementByClassName

byclass

NOTE : It’s good practice to avoid the use of above method, as there could be many edit boxes or buttons present on the screen, and we won’t get unique class name, still sometimes this can be useful if none of the locators work.

  • findElements

Above details talk about driver.findElement… to identify single element on application, but if we want to capture list of webelements, then we need to use driver.findElements…

if any options that are not mentioned above, then type driver. and key press CTRL + SPACE to get all the options to identify elements.

Content posted is based on learning or working experience, please leave comments if anything needs to be added or updated, discuss your queries on our facebook:qavalidation.com, Thanks!

1 Response

  1. June 10, 2016

    […] How to find appium locators […]

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: