iOS Screen rotation - WebDriverException

Hi there,
I’m facing a problem with iOS screen rotation. I have a feed in my application where I scroll to the video and press on it to start playing. In that moment i call:

driver.rotate(ScreenOrientation.LANDSCAPE);

… but I get “WebDriverException”.

I tried to put breakpoint before this command and then rotate the simulator with it’s settings and then put it back to ‘portrait’ mode. In this moment if I run the “driver.rotate()”, the command rotates the simulator successfully too.
Is this a known bug and how to avoid WebDriverException?

What’s the specific WebDriverException you’re getting, and what is the error in the Appium log?

I’m sorry for such late reply:

org.openqa.selenium.WebDriverException: Unable To Rotate Device
Command duration or timeout: 0 milliseconds
Build info: version: ‘3.11.0’, revision: ‘e59cfb3’, time: ‘2018-03-11T20:26:55.152Z’
System info: host: ‘davorinm-macmini.inova.intra’, ip: ‘fe80:0:0:0:8d3:6be3:cb15:d841%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.13.4’, java.version: ‘1.8.0_161’
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities {app: /Users/zigas/Projects/Confi…, autoGrantPermissions: false, automationName: XCUITest, browserName: , connectHardwareKeyboard: false, databaseEnabled: false, deviceName: iPhone 8, fullReset: false, interKeyDelay: 500, javascriptEnabled: true, language: en, launchTimeout: 300000, locale: en_US, locationContextEnabled: false, maxTypingFrequency: 30, networkConnectionEnabled: false, newCommandTimeout: 1800, noReset: false, platform: MAC, platformName: MAC, platformVersion: 11.4, takesScreenshot: true, udid: A8C341A5-1156-48C0-AF1D-5A6…, useJSONSource: true, webStorageEnabled: false}
Session ID: 3dd7c947-7cc4-4566-9212-76f6140defc6
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:129)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at io.appium.java_client.AppiumDriver.rotate(AppiumDriver.java:242)
at ios.tests.feed.VideoTest.iOSVideoPlayerTest(VideoTest.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)