View Source Improve this doc

getOrientation

Get the current browser orientation. This command only works for mobile environments like Android Emulator, iOS Simulator or on real devices.

Usage

1
browser.getOrientation();

Example

getOrientation.js
1
2
3
4
it('should get the orientation of my mobile device', function () {
var orientation = browser.getOrientation();
console.log(orientation); // outputs: "landscape"
});

Returns

  • <String>: device orientation (landscape/portrait)

Support

Support for android Support for ios

Uses