w3c / webdriver

Remote control interface that enables introspection and control of user agents.
https://w3c.github.io/webdriver/
Other
679 stars 194 forks source link

Recognise browsers device ratio when getting element rect #1729

Open christian-bromann opened 1 year ago

christian-bromann commented 1 year ago

It seems like getting the element rect doesn't recognise the browsers device ratio when running tests in a mobile browser, e.g. given on a browser I am able to target the center of an image:

image

The same procedure fails when running in a mobile browser:

image

I can provide a better example using Puppeteer but before I do that I would like to know if this would be something the spec authors would consider adding to the spec.

whimboo commented 1 year ago

@christian-bromann the webdriverio issue mentions Chrome but there is no info if Firefox behaves the same. Can you verify that this is not just a driver/browser issue?

normanlei0901 commented 1 year ago

@whimboo @christian-bromann I can't really reproduce the issue on Firefox in real Android device, because I don't have a physical Android device with me recently, and Browserstack doesn't support automation on mobile Firefox browser. FYI, I used the recent released playwright android, and it is working fine and I just ran automation on a real Samsung Tab A8 device with wdio, and the image.click() turned out different in portrait mode and landscape mode as well. It can hit the center in portrait mode but not in landscape mode fyi

whimboo commented 1 year ago

@christian-bromann could you please have a look if that issue can also be reproduced in Firefox? Thanks.