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..?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11957
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: iOS: App with multiple UIWindows

Post by Support Team » Fri Apr 26, 2019 1:04 pm

Hello ios_tester,

I'm afraid it is hard to give you any suggestions without analyzing the issue in more depth. Would you mind contacting us via the online support query and attach the IPA file if possible? We will be happy to help you to analyze the issue.

Thank you!

Regards,
Bernhard
.
Image