Hey
I am using Appium v1.3.4.1 and appium-java-client 2.1.0 and I am getting the following error when trying to use AppiumDriver.rotate(ScreenOrientantion orientation)
info: --> POST /wd/hub/session/20134e12-1a9f-4265-b96a-6fb4437092bb/orientation
{“orientation”:“LANDSCAPE”}
info: [debug] Pushing command to appium work queue: [“orientation”,{“orientation
“:“LANDSCAPE”}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”
:“orientation”,“params”:{“orientation”:“LANDSCAPE”}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: orientation
info: [debug] [BOOTSTRAP] [debug] Desired orientation: LANDSCAPE
info: [debug] [BOOTSTRAP] [debug] Current rotation: ROTATION_0
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:“Set the orientatio
n, but app refused to rotate.”,“status”:13}
info: [debug] Responding to client with error: {“status”:13,“value”:{“message”:”
An unknown server-side error occurred while processing the command.”,“origValue”
:“Set the orientation, but app refused to rotate.”},“sessionId”:“20134e12-1a9f-4
265-b96a-6fb4437092bb”}
info: <-- POST /wd/hub/session/20134e12-1a9f-4265-b96a-6fb4437092bb/orientation
500 2077.327 ms - 216
Here are details about the problem:
- for some reason, when appium executes the rotation command the AutoRotation function of the device is disabled (don’t know if this is how appium works in the background).
- the problem only occurs if I wait for the screen to completely load (add waits or Thread.sleep). So for example the rotation occurs WHILE the screen is loading, I do not get the error.
- the device autorotation LOCK remains active up until the UiAutomator sends the shutdown command, at which point, the app is minimized and the screen ROTATES while the desktop is being loaded. ALSO, if i minimize the app, the rotation occurs as soon as the app is minimized.
- UPDATE: if I run a command like .openNotifications() before running the rotation command, the rotation time is really low (.2 seconds even lower sometimes), without running a command like this the rotation usually takes .7-.8 seconds). How can this be?
Can someone help me understand why appium can rotate screens that are loading, but fails to rotate them when you wait for the screen to load successfully?
ALL wait actions return 200 OK in appium server.
Thank you