iOS: App with multiple UIWindows

Mobile Testing, Android App Testing.
ios_tester
Posts: 2
Joined: Thu Apr 11, 2019 10:01 am

iOS: App with multiple UIWindows

Post by ios_tester » Thu Apr 11, 2019 10:28 am

Hello,

we are trying Ranorex with a iOS app and so far it's great except for one thing which has to do with multiple windows.

Background:

We display alerts and password prompts using UIAlertControllers that are shown UIWindows that are above the default UIWindow where all the view controllers are. Here's a code example of how we do it:

Code: Select all

let window = UIWindow(frame: UIScreen.main.bounds)
let transparentViewController = UIViewController()
transparentViewController.view.backgroundColor = .clear
window.rootViewController = transparentViewController
window.windowLevel = UIWindow.Level.alert + 1
window.makeKeyAndVisible()
transparentViewController.present(alertController, animated: true, completion: nil)
Problem:

Usually after dismissing the alert the alertController everything is dismissed out of memory because nothing is holding any references to it. But it seems that Ranorex is indeed holding references that prevent the UIWindow from being deallocated. Therefore the UIWindow appears to remain and there's no way to tap anything any more. This effectively prevents any further testing.

Furthermore, the View Hierarchy looks strange. It seems that to Ranorex the alert window is somehow a child window of the first/root window.

I'd appreciate any tipps on how to handle this scenario. (However: We do want to keep the multi window approach.)

ios_tester
Posts: 2
Joined: Thu Apr 11, 2019 10:01 am

Re: iOS: App with multiple UIWindows

Post by ios_tester » Wed Apr 24, 2019 9:31 am

No tips..?