How to change orientation of mobile devices while running test execution in Java?

Please help me that how we can change orientation of mobile device in between the test execution in java?

Hi Richard,

For changing within a mobile device, users need Appium driver to rotate the orientaion:

driver.rotate(ScreenOrientation.LANDSCAPE); //or PORTRAIT