How to locate elements on already installed iOS App using XCUITest?

Hello folks,

I am new to iOS automation using XCUITest… I am having latest Appium installed in my MAC, and have iOS 11.2.1 enabled iPhone 5s. I want to know how to locate elements in already installed application? i.e; if I want to locate element of WhatsApp, how can I do that?

Many thanks in advance.

Thanks!

I am new to this but i don’t know if this might be of any help.
[https://github.com/appium-boneyard/javascript-workshop/blob/master/tests/functional/ios/native-specs.js] .

I guess something like:
.waitForElementByAccessibilityId('ComputeSumButton')
.click().sleep(1000)
.elementByClassName('UIAStaticText')
.text().should.become('18')