BrauzerLab
← Back to missions 7 / 50

Filter by Inner Element

Medium ~180 sec

Among the product cards, only one has a «New» badge. Since there is no unique selector on each card, you need to identify the right card first.

The filter() method lets you narrow a locator result based on text or an inner element. It is especially powerful for distinguishing cards, rows, and list items that share the same structure.

page is already available. Click the card that contains the «New» badge.

TASK

Click the product card that has the «New» badge.

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

test('Filter by Inner Element', async ({ page }) => {
  await page.goto('https://lab.local/mission/filter-has-locator');
  // ↓ Your code goes below ↓
});
Editor
https://lab.local/mission/filter-has-locator
Loading...
Results will appear here — press Run or Check.