Appium v1.9.1
python-client 0.28
Hello, was wondering if there is a way to change the window size for iOS to use the true resolution of the device rather than a scaled version? OR have find_element_by_image() use a scaled version screenshot as a reference image.
Cheers,
BACKGROUND
I’m using the -image locator option but I can’t seem to get iOS to tap on the image after locating it (no issues with Android using the default settings)
Seems due to pixel scaling on iOS, the location tapped is off.
DEVICE INFO
iPhone 7 - 11.4 --> 750x1334 (True resolution)
driver.get_window_size() --> 375 * 667 (scaled resolution)
DETAILS
-
Using find_element_by_image() returns an ImageElement based off of the true resolution of the device. This includes the center_x and center_y values. For example, lets say the values are x=100, y=200
-
Creating a reference image using save_screenshot(), I confirmed the coords from ImageElement are correct. Ie. x=100 and y=200 is the center of the image element.
NOTE: save_screenshot() creates a PNG image with the true resolution
- When ImageElement.click() is called, I noticed a different element is tapped.
Doing some debugging, I realized it was tapping on x=100, y=200 on the scaled resolution(375 * 667)