Skip to content

Commit 67074fa

Browse files
fix: getScreenViewPort
1 parent c4438d9 commit 67074fa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/appium-driver.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1011,16 +1011,16 @@ export class AppiumDriver {
10111011
public getScreenViewPort(): IRectangle {
10121012
const rect = this.getScreenActualViewPort();
10131013
if (rect
1014+
&& this.isIOS
10141015
&& Object.getOwnPropertyNames(rect).length > 0
1015-
&& this._args.appiumCaps.device.deviceScreenDensity) {
1016+
&& this._args.device.deviceScreenDensity) {
10161017
return <IRectangle>{
1017-
x: rect.x / this._args.appiumCaps.device.deviceScreenDensity,
1018-
y: rect.y / this._args.appiumCaps.device.deviceScreenDensity,
1019-
width: rect.width / this._args.appiumCaps.device.deviceScreenDensity,
1020-
height: rect.height / this._args.appiumCaps.device.deviceScreenDensity,
1018+
x: rect.x / this._args.device.deviceScreenDensity,
1019+
y: rect.y / this._args.device.deviceScreenDensity,
1020+
width: rect.width / this._args.device.deviceScreenDensity,
1021+
height: rect.height / this._args.device.deviceScreenDensity,
10211022
}
10221023
} else {
1023-
logError("Device's density is undefined!");
10241024
return rect;
10251025
}
10261026
}

0 commit comments

Comments
 (0)