getOrientation

Get the current browser orientation.

Usage

1
client.getOrientation().then(callback);

Parameters

Param Type Details

Example

getOrientation.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var client = require('webdriverio').remote({
desiredCapabilities: {
browserName: 'safari',
platform: 'OS X 10.9',
deviceName: 'iPad',
device: 'iPad Simulator',
platformVersion: '7.1',
platformName: 'iOS',
app: 'safari',
'device-orientation': 'landscape'
}
})

client
.init()
.getOrientation().then(function(orientation) {
console.log(orientation); // outputs: "landscape"
})
.end();

Uses