Mobile browsers generally have multiple UI states, and these states can affect properties of the browser like the size of the layout viewport. Although WebDriver users could try to adjust the size of the viewport directly using emulation commands:
- This may not actually work on real mobile devices
- Getting realistic results requires users to know the correct target size for browser / device combinations they care about.
A possible alternative is to just have a command that directly sets the UI state like browser.setUIState({"state": "visible"}). The problem is that different browsers may have different UI states (visible/hidden is very common on mobile today, but there's no reason to assume things will always work like that). We could have something like browser.getUIStates(), which would return a list of valid states for the current browser, but it's unclear if this kind of one-parameter API is flexible enough.
Mobile browsers generally have multiple UI states, and these states can affect properties of the browser like the size of the layout viewport. Although WebDriver users could try to adjust the size of the viewport directly using emulation commands:
A possible alternative is to just have a command that directly sets the UI state like
browser.setUIState({"state": "visible"}). The problem is that different browsers may have different UI states (visible/hidden is very common on mobile today, but there's no reason to assume things will always work like that). We could have something likebrowser.getUIStates(), which would return a list of valid states for the current browser, but it's unclear if this kind of one-parameter API is flexible enough.