I have recently started automating iOS apps on iPhone real devices with the XCUI test setup.
I got a scenario where my app contains 5 screens in the home page, each screen contains a unique card number and its balance so i have to fetch the card number from the screen and verify it with my input(expected) card number, if both are same then i have to click on the card screen otherwise if both are not same then i have to swipe right to the second screen and do the same process.
I was able to automate this scenrio in android perfectly because in android each screen is clearly differentiated with a unique card number but when i inspect the card number screen on iOS app it was showing all the list of cards attached to the app. in this case its getting difficult for me to get the card number from the app and verify it with my input card number . please see the below code which am already using it for android
String oysterCardVisibleNumberOnApp= data.get("PrestigeCardNumber");
while(!action.getText(HomePage.oysterCardNumber,"oysterCardNumber").equalsIgnorecase(oysterCardVisibleNumberOnApp))){
action.swipeRightToLeft();
}
it would be great if any one has any idea how to retrieve the list of elements/cards from the iOS app please let me know. or if you know any new methods in XCUI setup will help me to achieve this then please let me know. your help will be much appreciated :)
Please see the below Android Screen & iOS Screen pictures for getting more clarity
Thank you