XPath
A query language for picking parts of an XML or HTML document by their position in the tree.
In more detail
Paths such as //div[3]/button depend on the exact page structure. They break whenever the layout changes, so role-based locators are preferred in tests.
Related terms
- locator — An object in a test that describes how to find an element on the page, such as “the button named Submit”.
- CSS — The language that describes how web pages look: colours, fonts, spacing, layout and animation.
- DOM — The tree of objects a browser builds from a web page, which scripts read and change to update what is on screen.
Taught in
- End-to-End Testing with Playwright: Multi-Tier Suites — Production Full-Stack Engineering