Making an In-App Purchase (IAP) on iOS brings an Apple alert and puts the application into the background. If I use the Appium framework for automation, will I be able to interact with these prompts? Bonus if you could point me to an example of it. It was not immediately obvious to me that this was supported, though my understanding is that that UIAutomation framework might support this and that Appium calls into that framework. I'm in the process of evaluating frameworks.
Appium have capabilities to auto accept or dismiss the alerts, you can use these capabilities to complete your flow, as per your requirements:
autoAcceptAlerts = true capabilities.SetCapability("autoAcceptAlerts", true);
autoDismissAlerts = true capabilities.SetCapability("autoDismissAlerts", true);
Furthermore, some of the older versions of Appium haven’t worked with this solution, so you might want to try a small workaround with this:
Note : If Auto accept/dismiss capabilities used, it will accept/dismiss all the alerts of the application automatically.
I have not actually implement this scenario @Ben. But as you said,
- IAP process may take you out of the app. Most probably browser
- In that cases its possible to automate it
I am confident because
- I have automated successfully the scenario where my app also redirect user on browser.
- I'll say it would be the power of Appium to have support for Web and mobile platform in a same & single test.
Please give a try and let us all know if any smarter ways or challenges you face.