Skip to content
Software Testing Journal
Software Testing Journal

Your daily dose of learning!

  • Blog
  • Help Center
  • Video Playlist
  • Podcast & FAQ
  • Privacy Policy
Software Testing Journal

Your daily dose of learning!

Playwright

Playwright: Context Options Configuration

Dheeraj Gambhir, 2023-10-262023-10-26

Another great feature of the Playwright (Context Options Configuration)

You can use it to create numerous browser contexts with various setups. This is helpful for simulating various testing scenarios. For example, you may replicate a scenario in which a user visits your site incognito on iPhone 14:

Sample code (Javascript):

const iPhone14 = playwright.devices[‘iPhone 14’];
const context = await browser.newContext({
…iPhone14,
isMobile: true,
hasTouch: true,
javaScriptEnabled: true,
colorScheme: ‘light’,
acceptDownloads: true
});
const page = await context.newPage();

If you find this post helpful, please share them with your colleagues and friends.

  • Facebook
  • Twitter
  • LinkedIn
  • Email
Playwright AutomationTips

Post navigation

Previous post
Next post
©2025 Software Testing Journal | WordPress Theme by SuperbThemes