天天看點

katalon完成自适應分辨率

分辨率:1920*1200

Mobile.swipe(1700, 140, 1000, 140)

1700/1920=0.885 1000/1920=0.52 140/1200=0.117

完成自适應分辨率:

x1 = (0.885 * Mobile.getDeviceWidth())

x2 = (0.52 * Mobile.getDeviceWidth())

y = (0.117 * Mobile.getDeviceHeight())

int x_1 = ((x1) as int)

int x_2 = ((x2) as int)

int y_1 = ((y) as int)

Mobile.swipe(x_1, y_1, x_2, y_1)