Appium-Get Orientation(获取定位)

快来打我* 2022-11-17 10:19 247阅读 0赞

Get Orientation

          • Example Usage
          • Support
            • Appium Server
            • Appium Clients
          • HTTP API Specifications
            • Endpoint
            • URL Parameters
            • JSON Parameters
            • Response

Get the current device/browser orientation //获取当前设备/浏览器方向

Example Usage

































Java ScreenOrientation orientation = driver.getOrientation();
Python orientation = self.driver.orientation
Javascript // webdriver.io example
let orientation = driver.getOrientation();
// wd example
let orientation = await driver.getOrientation();
Ruby # ruby_lib example
orientation
# ruby_lib_core example
@driver.orientation
C# ScreenOrientation orientation = driver.Orientation;
PHP // TODO PHP sample
Support
Appium Server

详见

Appium Clients

详见

HTTP API Specifications
Endpoint

GET /session/:session_id/orientation

URL Parameters













name description
session_id ID of the session to route the command to
JSON Parameters

None

Response

The current browser orientation {LANDSCAPE|PORTRAIT} (string) //当前浏览器方向{横向|纵向}(字符串)

发表评论

表情:
评论列表 (有 0 条评论,247人围观)

还没有评论,来说两句吧...

相关阅读

    相关 HTML5: Screen Orientation API

    媒体查询允许网站根据智能手机和平板的方向来调整布局。但有时候你希网站锁定到一个特定的方向,横屏或竖屏,此时,原生应用的格式是可以被指定的。APP只在预设格式下显示—独立于实际的