Squad Bench · Add/Remove Elements
Click to add substitute players to the bench, each with its own Delete button. Counting elements that come and go is the exercise.
Substitutes on, substitutes off. The gaffer wants exactly four on the bench.
Add/Remove Elements is an easy Waits & Dynamics challenge on Fun UI Playground. Click to add substitute players to the bench, each with its own Delete button. Counting elements that come and go is the exercise. It runs entirely in the browser, with no backend. Every interactive element carries a stable id and data-testid prefixed with “add-remove-”, and the techniques it exercises are click to create elements, locate dynamic elements, count elements, delete elements.
At a glance
- Category
- Waits & Dynamics
- Difficulty
- easy
- Teaches
- click to create elements · locate dynamic elements · count elements · delete elements
- Backend
- None — runs entirely in the browser
- Locators
- Stable
idanddata-testid, prefixedadd-remove-
Selectors on this page
| Locator | What it is |
|---|---|
#add-remove-add #add-remove-bench | Add: #add-remove-add · each substitute renders as button.added-manually inside #add-remove-bench |
#add-remove-count | Live count in #add-remove-count — assert it after each add/delete |
Frequently asked questions
How do I count elements that are added and removed dynamically?
Click #add-remove-add to append button.added-manually elements inside #add-remove-bench, and assert the live total in #add-remove-count after each add or delete. Counting a locator's matches works too, provided you re-evaluate it rather than reusing a captured list.
How do I delete a specific dynamically added element?
Every substitute deletes itself when clicked, and substitutes are numbered deterministically (Sub 1, Sub 2, …) within a visit — so locate by visible text, click it, then assert both its disappearance and the new #add-remove-count.
More Waits & Dynamics
- Transporter Room · Dynamic Loading
- Paddock Controls · Dynamic Controls
- Pizza Order Toasts · Notification Messages
- The Bounty Board · Dynamic Content
- Endless Deals · Infinite Scroll
- Pit Wall Telemetry · Streaming Feed
- The Revolving Door · Stale Elements
- All Waits & Dynamics challenges
Updated
Fun UI Playground — all challenges, bug hunts, getting started, glossary, about.