BrauzerLab
← Back to missions 31 / 50

Strict Mode — Three Identical Buttons

Medium ~180 sec

The form has three sections — each with an identically-named Submit button. Your job is to click only the Section 2 button.

A broad locator like getByRole('button', { name: 'Submit' }) will match all three buttons and trigger a strict-mode violation. The correct approach is the scoped locator technique — select the parent container first, then navigate to the button inside it.

page is ready. All three sections have id and data-testid attributes — use them.

Scoped locator, a direct id, or data-testid — all correctly target the Section 2 button.

TASK

Disambiguate the declared elements.

Provided for you
import { test, expect } from '@playwright/test';

test('Strict Mode — Three Identical Buttons', async ({ page }) => {
  await page.goto('https://lab.local/mission/strict-mode-disambiguation');
  // ↓ Your code goes below ↓
});
Editor
https://lab.local/mission/strict-mode-disambiguation
Loading...
Results will appear here — press Run or Check.