Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & Test Observability

Test mobile compatibility with Playwright emulation

Learn how to emulate real devices in Playwright tests on BrowserStack Automate

When using Playwright for test automation, pass the device parameteres to simulate real device browser behaviour to test your application.

Playwright emulation is currently supported with the NodeJS BrowserStack SDK and legacy integration.

Steps to run Playwright tests on device mode

The steps to pass device parameters are same as the ones you perform for integration. The only difference is that you have to specify Playwright emulation configurations under playwrightConfigOptions in the browserstack.yml file.

For example, you may only want to specify that the test runs on iPhone 6 and prefer a predefined configuration for the test. In that case, update the configuration in browserstack.yml as follows:

browserstack.yml
Copy icon Copy snippet

The configuration for iPhone 6 in deviceDescriptions.json are used for device simulation in the test.

However, if you want to use a custom configuration, update browserstack.yml as shown here:

browserstack.yml
Copy icon Copy snippet

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Download Copy