How to access id in UITabbar and Navigation bar

Am running script in iOS App, i can access the lables and buttons with their text name…

When come to UITabbar - it has 5 sets of id which is in footer, i could not locate the item id in the footer via Appium inspector, it take it as a single view.

Same way for Top Navigation bar, it has back button and share link.

How to access these element?
In iOS, We can locate the element only via its label not id, like in Android can’t we access element using it’s id?

Thank You

Can you locate what you want via xCode inspector?

am only getting coordinates for that element in Appium Inspector, text name in xCode Inspector.

How to access ios elements via id like Android as"xyz)

with iOS id is attribute name in page source. for example:

<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" enabled="true" visible="true" x="76" y="359" width="279" height="21" name="title" label="Shared balance" value="Shared balance">

to find above element we need:"title")

name refers to text in the particular element

i have a button its id in layout as myProfileButton, the text in the button is “Register Here”…

If i try to access the element, am getting “Register Here” in name not myProfileButton.

How to access layout id “myProfileButton” instead of lable in the button in iOS?

Also, if 2 label has same text, how it will be accessed?

Get page source needed screen of your app and check. We do not have your app.

Once again text can be in following attributes: name, value and label.
While id is only in name.
When element does not have id it often has value of text. This is just iOS behavior.

Thanks, now i can access the element, when take page soure am getting name… but when come to image like back button in navigation header how to access it?

Same way. If it absent in page source ask developers to make needed element accessible.

Whether webview elements are accessible only via xpath…

i tried in iOS, i can give the name in id it’s working

but in Android,

MobileElement el5 = (MobileElement) driver.findElementByXPath("//android.view.View[@content-desc=“Continue with Mobile Number”]/android.widget.TextView");;

But xpath makes the process too slow, it is not advisable to use xpath right?

Then how to access webview elements? i have enabled webview.setWebContentsDebuggingEnabled(true);
eventhough i can access only via xpath…

to access web elements you need switch context to webView of your app. and search elements like in pure web.
more to read

ok Thank you, i will try this.

Same way any option to access list items and handle clicks?