c# - 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);
解决方案
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'.
推荐阅读
- json - 如何将此对象从json反序列化为字符串?
- wordpress - 删除特定分类类型的 paging_base
- java - 从 build.gradle 访问 java 类的变量
- scala - 无法将 [-] 应用于 scala 中的 AnyVal
- javascript - 如何在节点 js 中使用 nodeMailer 解决电子邮件发送问题“内部服务器错误”
- mongodb - 没有mongod的错误mongo在win 10中首先在本地运行
- spring-scheduled - 如何使用带有@scheduled注解spring boot的多个cron表达式
- docker - NGINX 与 OpenResty 缓存性能对比
- excel - 过去 12 个月内日期的 COUNTIFS
- c++ - 如何将括号中的字符串解析为具有给定分隔符的字符串列表