Skip to content

Parameterize behavior on clicking a link that opens a new tab #602

Closed
@kamath

Description

@kamath

Make an act flag that can parameterize the new tab behavior in the example below, such that the user can choose whether or not to switch to the newly opened tab.

await page.goto("https://playwright.dev");
  await page.setContent(`
      <html>
        <body>
          <a href="https://playwright.dev" target="_blank">Open Playwright</a>
        </body>
      </html>
    `);
  await page.act("Click on Open Playwright link");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions