Hacker News new | ask | show | jobs
by LoSboccacc 2070 days ago
> you no longer need random time.sleep()

you never needed that, selenium always had multiple method available to wait for page loads or to wait for specific div to become available in the dom or visible in the viewport.

anyway, I don't understand the usefulness of a mobile web render into a browser: a tall, narrow frame is no substitute of a mobile device. for one the rendering engine is not the same, secondly you don't get touch events generated for it, thirdly hover and pixel density media queries straight up won't work

1 comments

Selenium can use Chromedriver's device emulation mode (eg "add_experimental_option("mobileEmulation", {"deviceName": "iPhone X"})") to enable touch events, pixel density, etc. It's not the same as testing on a real device but it's still useful to have as part of a test pipeline if you don't have the budget for every device you need to test on.

https://chromedriver.chromium.org/mobile-emulation