PracticeQAAutomation logoPracticeQAAutomation

Hidden Elements

Elements hidden four different ways in CSS — practice distinguishing "in the DOM" from "visible", and waiting for one to become visible.

Hidden via display:none

You should never see this text.

Present in the DOM, but not rendered at all.

Hidden via visibility:hidden

Invisible but still takes up space.

Occupies layout space; most tools report it as not visible.

Hidden via opacity:0

Fully transparent text.

Technically "visible" to some visibility checks, but not to the eye.

Positioned off-screen

Off-screen text.

Rendered, but scrolled far outside the viewport.

Revealed on demand

Covered by an overlay (not interactable)

The button is visible, but a transparent layer sits on top — a normal click is intercepted.

Selenium throws ElementClickInterceptedException; Playwright waits and reports the element that "intercepts pointer events". Remove the overlay first — or (last resort) force the click.