How to run test in headed mode using VS Code

Hi Fred,

From the documentation for New Page:

When a New Page is called without an open browser, New Browser and New Context are executed with default values first.

The setting you are after is in New Browser:

headless = True bool

so you’ll want to change your test to:

*** Settings ***
Library Browser

*** Test Cases ***
Run Test
    New Browser    headless=False
    New Page    https://playwright.dev
    Get Text     h1    contains    Playwright

Dave.

2 Likes