Back to all steps
Emulate mobile device
Step fields
text
(text)
The rest of the run behaves like a phone: mobile User-Agent and Client Hints, mobile layout (meta viewport), touch and the device screen size. The open page is reloaded. Needed for sites that pick the mobile version on the server - a narrow window alone is not enough for them.
Format: device or device|width|height.
Devices: android (default) · iphone · samsung · a mobile browser profile key.
Format: device or device|width|height.
Devices: android (default) · iphone · samsung · a mobile browser profile key.
Usage example
Switch the run to a mobile device. Unlike setViewport,
it changes more than the window size: the site receives a mobile
User-Agent and Sec-CH-UA-Mobile: ?1, mobile layout (meta viewport)
and touch are enabled. This is what DevTools device mode does.
Format: device or device|width|height.
android- Chrome on Pixel 7, 412×915 (default)iphone- iPhone 15, 393×852samsung- Samsung Internetandroid|360|800- custom resolution
The open page is reloaded, new tabs are mobile too. Emulation lasts until the end of the run.
Typical scenario: emulateDevice android → got_to_page →
assertMobileLayout.
Note: on sites with strict anti-bot protection ("bypass protection" mode) device emulation may be noticed by the protection.