Currently, I am working in XCTest iOS framework and using .exists function to check the element presence. Want to know if there is any other way to check the presence of element on UI as .exists is getting problem. Tests get successful on the first run but when it runs second time, it gets failed because script clicks the element which is not exist on the UI might be because elements loaded first time in app remains hidden but exists.
Please let me know any function which checks the current screen elements presence.
I too am looking for a way to wait until an element appears instead of using the sleep method. sometimes UI elements take longer to load, but that doesn't mean it won't appear, eventually. At which point you can check use the .exists
There is a XCUIApplication Class Reference, not hosted by apple, but its in OBJ-C: http://masilotti.com/xctest-documentation/index.html
UPDATE: I think I found a solution from this link Delay/Wait in a test case of Xcode UI testing
Using the NSPredicate class worked for me.