VisualQ
Scenarios

Click selectors

Automate interactions before capturing screenshots.

Some pages require user interaction before they're in the right state for visual testing — closing a cookie consent banner, dismissing a popup, or expanding a collapsed section. Click selectors let you automate these clicks before VisualQ takes the screenshot.

How click selectors work

VisualQ executes clicks on the specified selectors in order, waiting for each to complete before moving to the next. After all clicks are performed and the configured delay has elapsed, the screenshot is captured.

Adding click selectors

From the scenario edit page, scroll to the Click Selectors section and add CSS selectors for elements that should be clicked.

Examples

#cookie-accept-button

Dismiss a modal

.modal-overlay .close-button

Expand an accordion

[data-accordion-trigger]:first-child

Execution order

Click selectors are executed sequentially from top to bottom. If the element matching a selector doesn't exist on the page, that click is silently skipped.

Make sure your selectors are specific enough to match exactly one element. If a selector matches multiple elements, only the first match will be clicked.

Tips

  • Use click selectors before content rules — the page state after clicks is what gets normalized and captured
  • Add a sufficient delay to allow the page to settle after clicks
  • Test your selectors in browser DevTools first to verify they target the right elements

On this page