resize
Set the browser viewport width and height
Set the Playwright viewport size. Both width and height must be positive integers.
Syntax
When I resize to "<width>" by "<height>"Qualifiers
| Qualifier | Role | Example |
|---|---|---|
to | Viewport width in pixels | resize to "375" by "812" |
by | Viewport height in pixels | resize to "375" by "812" |
by here is not a find hint — it pairs with to for height. Find hints use by aria-label / by id / … — see Find hints.
Requirements
| Item | Contract |
|---|---|
| Element / control shape | None — viewport size |
| How the label binds | Width to and height by are positive integer payloads (by here is not a find hint) |
| Qualifiers that change resolve | to + by |
| Platform | Web only |
| Wrong shape → use instead | N/A |
See also UI contracts.
Examples
When I resize to "375" by "812"Notes
- Web only. Appium /
Platform: apireturn unsupported.