UIAutomator2 incorrectly defines element coordinates and size on bottom of edgeless screen
See original GitHub issueHi! I’ve stumbled upon the following problem: i have Samsung A10 (screen from edge to edge) When i get size and location of element from middle or top of screen, everything is ok. But if i get size and location of element from bottom of screen, uiautomator2 returns location values that more than screen size. getDriver().manage().window().getSize() returns size of 720 x 1382 (size of screen) find(<element from bottom of screen>).getLocation() returns points 58 x 1406 (y-coordinate more than screen height)
Appium logs
[HTTP] --> POST /wd/hub/session/edcae5f9-7065-4e55-b245-25acf2ad5423/element [HTTP] {"using":"xpath","value":"//*[@text='Поиск']"} [debug] [W3C (edcae5f9)] Calling AppiumDriver.findElement() with args: ["xpath","//*[@text='Поиск']","edcae5f9-7065-4e55-b245-25acf2ad5423"] [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator [debug] [BaseDriver] Waiting up to 2000 ms for condition [debug] [WD Proxy] Matched '/element' to command name 'findElement' [debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8200/wd/hub/session/8e9b36c2-0de4-4cb2-aadb-998bcf7d116e/element] with body: {"strategy":"xpath","selector":"//*[@text='Поиск']","context":"","multiple":false} [debug] [WD Proxy] Got response with status 200: {"sessionId":"8e9b36c2-0de4-4cb2-aadb-998bcf7d116e","value":{"ELEMENT":"6892662f-8282-4aa6-b74b-ec17cea7bc08","element-6066-11e4-a52e-4f735466cecf":"6892662f-8282-4aa6-b74b-ec17cea7bc08"}} [debug] [W3C (edcae5f9)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"6892662f-8282-4aa6-b74b-ec17cea7bc08","ELEMENT":"6892662f-8282-4aa6-b74b-ec17cea7bc08"} [HTTP] <-- POST /wd/hub/session/edcae5f9-7065-4e55-b245-25acf2ad5423/element 200 588 ms - 137 [HTTP] [HTTP] --> GET /wd/hub/session/edcae5f9-7065-4e55-b245-25acf2ad5423/element/6892662f-8282-4aa6-b74b-ec17cea7bc08/size [HTTP] {} [W3C (edcae5f9)] Driver proxy active, passing request on via HTTP proxy [debug] [WD Proxy] Matched '/wd/hub/session/edcae5f9-7065-4e55-b245-25acf2ad5423/element/6892662f-8282-4aa6-b74b-ec17cea7bc08/size' to command name 'getSize' [debug] [WD Proxy] Proxying [GET /wd/hub/session/edcae5f9-7065-4e55-b245-25acf2ad5423/element/6892662f-8282-4aa6-b74b-ec17cea7bc08/size] to [GET http://localhost:8200/wd/hub/session/8e9b36c2-0de4-4cb2-aadb-998bcf7d116e/element/6892662f-8282-4aa6-b74b-ec17cea7bc08/size] with body: {} [debug] [WD Proxy] Got response with status 200: {"sessionId":"8e9b36c2-0de4-4cb2-aadb-998bcf7d116e","value":{"width":64,"height":27}} [WD Proxy] Replacing sessionId 8e9b36c2-0de4-4cb2-aadb-998bcf7d116e with edcae5f9-7065-4e55-b245-25acf2ad5423 [HTTP] <-- GET /wd/hub/session/edcae5f9-7065-4e55-b245-25acf2ad5423/element/6892662f-8282-4aa6-b74b-ec17cea7bc08/size 200 46 ms - 85 [HTTP]
[HTTP] --> POST /wd/hub/session/cc2753d9-4bad-4793-8877-121f12c76e8f/element [HTTP] {"using":"xpath","value":"//*[@text='Поиск']"} [debug] [W3C (cc2753d9)] Calling AppiumDriver.findElement() with args: ["xpath","//*[@text='Поиск']","cc2753d9-4bad-4793-8877-121f12c76e8f"] [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator [debug] [BaseDriver] Waiting up to 2000 ms for condition [debug] [WD Proxy] Matched '/element' to command name 'findElement' [debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8200/wd/hub/session/2f63bdc9-b125-4850-ba87-aa8ec33ce5f7/element] with body: {"strategy":"xpath","selector":"//*[@text='Поиск']","context":"","multiple":false} [debug] [WD Proxy] Got response with status 200: {"sessionId":"2f63bdc9-b125-4850-ba87-aa8ec33ce5f7","value":{"ELEMENT":"c52eec2a-64a9-43bf-9cfb-f6f9e27f8b63","element-6066-11e4-a52e-4f735466cecf":"c52eec2a-64a9-43bf-9cfb-f6f9e27f8b63"}} [debug] [W3C (cc2753d9)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"c52eec2a-64a9-43bf-9cfb-f6f9e27f8b63","ELEMENT":"c52eec2a-64a9-43bf-9cfb-f6f9e27f8b63"} [HTTP] <-- POST /wd/hub/session/cc2753d9-4bad-4793-8877-121f12c76e8f/element 200 793 ms - 137 [HTTP] [HTTP] --> GET /wd/hub/session/cc2753d9-4bad-4793-8877-121f12c76e8f/element/c52eec2a-64a9-43bf-9cfb-f6f9e27f8b63/location [HTTP] {} [W3C (cc2753d9)] Driver proxy active, passing request on via HTTP proxy [debug] [WD Proxy] Matched '/wd/hub/session/cc2753d9-4bad-4793-8877-121f12c76e8f/element/c52eec2a-64a9-43bf-9cfb-f6f9e27f8b63/location' to command name 'getLocation' [debug] [WD Proxy] Proxying [GET /wd/hub/session/cc2753d9-4bad-4793-8877-121f12c76e8f/element/c52eec2a-64a9-43bf-9cfb-f6f9e27f8b63/location] to [GET http://localhost:8200/wd/hub/session/2f63bdc9-b125-4850-ba87-aa8ec33ce5f7/element/c52eec2a-64a9-43bf-9cfb-f6f9e27f8b63/location] with body: {} [debug] [WD Proxy] Got response with status 200: {"sessionId":"2f63bdc9-b125-4850-ba87-aa8ec33ce5f7","value":{"x":58,"y":1406}} [WD Proxy] Replacing sessionId 2f63bdc9-b125-4850-ba87-aa8ec33ce5f7 with cc2753d9-4bad-4793-8877-121f12c76e8f [HTTP] <-- GET /wd/hub/session/cc2753d9-4bad-4793-8877-121f12c76e8f/element/c52eec2a-64a9-43bf-9cfb-f6f9e27f8b63/location 200 69 ms - 78 [HTTP]
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
@remimarenco i created the bug in issueTracker for Android SDK. They set minor priority and i don’t see any activities with this bug. We are still using devices without edgeless screen for automation. Now i’m researching in cloud device farm approach. I came to a conclusion that it’s easier to give test balancing for the third parties. Maybe there is no such problem with cloud farm devices. But i haven’t tryed yet
@qaschevychelov Do you have a summary of what was the issue and if you solved it? We have also troubles with this on Gestures (component is not at the right coordinates, it seems like).
We can’t see the content of the issuetracker unfortunately.
Thanks!