UI Testing Failure: Failed to update to requested orientation
Asked Answered
I

1

6

Sometimes under continuous integration there is an error (seem to be random error) like this:

Test Assertion UI Testing Failure - failed: Failed to update to requested orientation.

enter image description here

While testing, device is rotated to the landscape mode and... it does not return back to the portrait mode. Why?

Do you know what may cause such Issue?

In code I have a lines:

XCUIDevice.shared().orientation = .landscapeLeft
XCUIDevice.shared().orientation = .portrait

It looks like related to the following part of code, but I do not know how to solve it.

enter image description here

Inandin answered 7/10, 2016 at 12:15 Comment(4)
can check this by using PortraitUpsideDown instead of portrait?Leandro
How this would help?Vaules
actually i used this two line in my app ui test portion , it can orient in landscape but can not in portrait mode. maybe there something probolem ... i also looking for itLeandro
Why do you think it will help?Vaules
D
1

There is basically nothing to solve this is a Xcode 8 bug. When you get this error just rerun nothing else to do atm. I never had this issue on Xcode 7. What the error message is telling you is that it failed to get the requested orientation and your code lines is looking good:

XCUIDevice.shared().orientation = .landscapeLeft
XCUIDevice.shared().orientation = .portrait

Apple will hopefully solve this issue soon. You also could report a bug to Apple too.

Demilitarize answered 15/10, 2016 at 5:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.