UI Test Error: Failed to update required orientation

Sometimes during continuous integration an error occurs (it seems to be a random error):

Error testing user interface validation. Error: Failed to update the required orientation.

enter image description here

During testing, the device turns into landscape mode and ... it does not return to portrait mode. Why?

Do you know what might cause such a release?

In the code, I have the lines:

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

This is similar to the next part of the code, but I don't know how to solve it.

Appreciate any help.

enter image description here

+6
source share
1 answer

Basically there is nothing to solve the problem with the Xcode 8 error. When you get this error, just don't run anything else to do atm. I never had this problem on Xcode 7. What the error message tells you is that it failed to get the requested orientation and your code codes look good:

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

Apple, I hope, will solve this problem soon. You can also report make a mistake for Apple.

+1
source

All Articles