首页 > 解决方案 > Change device orientation using Appium and C#

问题描述

Is there a way to change orientation using e.g. Driver class like this:

private void SetDeviceOrientation(string mode)
        {
            switch (mode)
            {
                case ("Landscape"):
                    driver.Rotate(ScreenOrientation.Landscape);

标签: c#seleniumautomationappium

解决方案


The documentation about setting the screenrotation suggests this should be possible. You should change the 'landscape' to uppercase. By researching the appium repository on github, it is mentioned in the ScreenOrientationExtension class as 'LANDSCAPE'.


推荐阅读