How to rotate ios simulator/device while running a test case

I’ve test case where i need to rotate simulator/real device screen while executing, so that new screen will displayed

How can i do perform this actions

IOS simulator version - 7.1
Appium - 1.2.0 (Cygnus)
Selenium - 2.42
java - 1.7

Hi @jagadeeshkotha!
Is

((AppiumDriver) driver).rotate(ScreenOrientation.LANDSCAPE);

appropriate?

@SergeyTichomirov Awesome man that’s worked perfectly for me

Thanks.

((AppiumDriver) driver).Rotate (ScreenOrientation.LANDSCAPE); you are realized in which class or function?

Is it C#?
Above I wrote about Java.
I am looking at the C# sources and I see that Rotate method is here…

This method is here since first versions of client libraries were published.

I use Java,Thank you

I’m using Ruby and rotate method does not work for me (undefined method). Does somebody know how to get the device orientation and rotate the device? Thanks

A bit late, but you can use the following sequence (assuming appium_driver is the variable that hold the reference to your Appium::Driver instance):

appium_driver.driver.rotate :landscape

(The Appium driver basically holds an internal reference to a Selenium driver, on which you can call rotate).

Can i have the same scenario script in PHP to rotate?

Hi!
Have you been solved?? I’m the same problem

Getting error

Can someone provide python equivalent for this?