Hey there:
Appium 1.4.0
ruby_lib 7.0
iPhone Simulator - iPhone 5S
Steps:
- I navigate to the screen listed below.
Expected Result: The ability to identify/click on the Submit/Cancel buttons.
Actual Result: I do not see this dialogue box. I cannot click on these buttons.
Note:
- I tried also alert_accept and alert_dismiss to no avail.
- The other UIAWindow in the inspector is the status bar. not the popup
Any help welcome
thanks in advance!
Eric
button('Submit').click
doesn’t work?
Also try different window numbers to the page command:
page window: 0
page window: 1
page window: 2
One of them will contain only the dialog.
Thanks for the quick responses! It seems like the original ‘page’ command found was the submit button that was below the Modal pop-up which was disabled.
I’m away from my computer for a few hours. I’ll try the page window commands you mentioning your second reply to see if I have any luck. Thanks again!
My advice is to have your devs add accessibility labels so you can differentiate between the two Submit buttons. At work we had to do this to all our elements to enable reliable automation.
Hi @bootstraponline,
I just tried taking your suggestions.
- Sadly page window: 0 (or 1, 2, or 3…) did not contain any of the dialog. 0 contained what I “paged” initially. 1 contained nil, 2 contained iOS stock “swipe to pull for notifications”
- From looking at the app source, it seems that this is a custom alert view. I can talk to the devs and try to add accessibility labels. My limited attempts on this didn’t seem to help.
- The only thing that seemed to show promise was
execute_script("UIATarget.localTarget().frontMostApp().windows()[0].getTree()")
3a. I was able to see the alert buttons here. I’m able to find the alert text on those buttons, get the x/y/width/height, and click on the midpoints of those buttons. So I think I’m good for now
Definitely, #2 above may prove more fruitful for me
Thanks again for your help! All the best.
Eric