In-App Purchase test. How to differentiate XCUITest vs. UiAutomation popups?

I think for ios version 9.3 up to 10 (not inclusive), both XCUITest/UiAutomator are supported. So that won’t always work.

My first approach was to poll the ios IAP native popups for either “XCUIElementTypeAlert” or “UIAAlert” elements and see which one was found. Using driver.findElementsByClassName(...). But turns out appium is automatically transforming “UIAAlert” to “XCUIElementTypeAlert”, so that didn’t work.

Looking for next approach to try…