Selector Steps

Named CSS and XPath registry plus 22 CMS / framework presets. Test maintenance teams gain stable test artifacts across redesigns.

Step phrasings in this group

The book sidebar lists each individual step page under this group.

When I add "mobile logo" selector for "header img#logo" css selector

Resolve a named selector to a Playwright-compatible selector string.

When I add "page title" selector for "//h1[contains(@class,'page-header')]" xpath selector

Register a named XPath selector at runtime.

When I add selectors from "selectors.json" file

Load CSS and XPath selectors from a JSON file.

Then I print css selectors

Print all registered CSS selectors to console (debug/inspection).

Then I print xpath selectors

Print all registered XPath selectors to console (debug/inspection).

Given define css selectors:

Define named CSS selectors in bulk for the current scenario.

Given define xpath selectors:

Define named XPath selectors in bulk for the current scenario.

Given I am viewing the site on a xl screen

Resize viewport to a named breakpoint.

Then I see header above footer

Assert a subject locator is above one or more others (absolute page coordinates).

Then I see footer below header

Assert a subject locator is below one or more others.

Then I see logo to the left of nav

Assert a subject locator is to the left of one or more others.

Then I see nav to the right of logo

Assert a subject locator is to the right of one or more others.

Then I see logo inside of header

Assert a subject locator's bounding box is fully inside another's.

Then I see header outside of logo

Assert a subject locator's bounding box fully contains another's.

Then I see modal over content

Assert a subject locator overlaps another via intersection and z-index.

Then I see header not over content

Assert a subject locator does NOT overlap another element.

Then I see visible header

Assert one or more named locators are visible.

Then I don't see modal

Assert one or more named locators are hidden.

Then I see search has focus

Assert a named locator has keyboard focus.

When I move focus to "Title" field

Resolve a form field by label → placeholder → role=textbox → [name]/#id.

When I select all text in "Title" field

Select all text inside a field by label, name, or id.

When I select from 0 to 5 text in "Title" field

Select a character range (from..to) inside a field.

When I select "title name" text in "Title" field

Select a specific substring of text inside a field.

When I click nav

Click one or more named components uses locator.click() which auto-scrolls.

Back to all step groups