Closed vnuta9 closed 1 year ago
This is strictly related to how Google UiAutomator and Apple XCTest frameworks are designed.
The first one uses physical pixels which are counted in absolute coordinates (top left corner of the screen is [0,0]). It is also known to only return coordinates of the area which is actually intractable and can accept automated gestures. That is why the bottom bar containing navigation controls is usually excluded from these metrics.
The second one uses coordinates for each application window measured in logical pixels (top left corner of app window is [0,0]). Also, I don't think there is any way in iOS to know the absolute position of your application window (correct me someone if I'm wrong).
I have some 10 method calls in my appium(ver2.0.0-beta71) QA testing code with absolute pixel measurements, which I have to correct by translating them to screen size percentage terms. I queries using Java-Client 8.5.1 for window size=driver.manage().window().getSize() which returned
Pixel4 >>> Window size=1080 X 2214
iPhoneXS >>>Window size=375 X 812 By googling I found this at https://yesviz.com/ that
Google Pixel 4 resolution is 1080 x 2280 PX with ~ 444 pixel desnsity. Google Pixel 4 viewport size is 393 x 830 PX with ~ 161 actual pixel density
iPhone XS has a 5.8-inch screen with a screen size (resolution): 1125px × 2436px, 375px × 812px viewport1,
As I also read that resolution is physical pixel count, and viewport is software pixel count.
But why I am getting physical pixel count for Pixel4 Android phone and viewport pixel count for iPhone ?? How to reconcile this and convert in to window size percentages ?