Bhavik Tikudiya
Bhavik Tikudiya

Reputation: 103

Get all UI locators from Android/iOS screen for Mobile Automation Testing

Problem Definition: I am trying to develop a Utility which can mirror an Android/iOS device screen in my windows and on a button click it provides all the locators available on the screen in one xls file.

I am trying to find a direction to work on this. Till now i am able find that using ddmlib library for Android we can interact with DDMS. I do not know how to interact with this ddmlib library. Plus is it possible to mirror Android Screen using the ddmlib library? still a question to me.

On iOS front no luck.

Looking for a direction. Thanks!

Upvotes: 2

Views: 1592

Answers (2)

Durai Amuthan.H
Durai Amuthan.H

Reputation: 32270

You can ask the developer to set the same ids of Android to iOS UI views

they just have to set the Accessibility Identifier to each element would solve the issue.

they can do it in Interface builder or programatically

view.AccessibilityIdentifier = "CreditCardTextField";

or else you have to find xpath for each element and do it which is harder

Upvotes: 1

sunder kandasamy
sunder kandasamy

Reputation: 190

You can just inspect elements for both android and ios usiing appium inspector..

There is a Copy XML button in appium inspector which will save all locators as a xml file on single button click

Upvotes: 0

Related Questions