Recommendation
Structuring the object repository for autotests
Structuring the object repository for autotests
Recommendation on how to keep the object repository so ComplexQA autotest steps reuse paths and locators without copying them.
Why
One control in ten autotests with different locator strings breaks in ten places at once. A catalog page and element give a single edit point and a stable Target for steps.
How to work
- Create a page for a stable screen path (kind
PAGE). Store a screen on the same host as the run starting domain as a relative path. Store a screen on a team subdomain (after a click insideCOMMON) as a fullhttps://{slug}.host/…URL. A verified root covers its subdomains. A relativegotoalways joins the starting domain of the run, not the current tab. - Group pages and elements in folders that match screens or areas of the product. Drag a row onto a folder in the tree, including onto an empty folder. At the tree root the table lists every record in the project; open a folder to narrow the list.
- Create elements for that page's controls (kind
ELEMENT) with an unambiguous locator: preferTESTID,ROLE,LABEL. - Name records so a step author finds them without guessing (screen + control role).
- In steps, pick the catalog element or page instead of an on-step locator when Target repeats. Flow: Binding a Target from the object repository.
- Draft steps from a catalog page: Autotest generation from a page.
- After product markup changes, fix the locator on the catalog element, then re-run the affected
CASEitems.
What to avoid
| Bad | Good |
|---|---|
| One «universal» element for the whole product | An element for a specific page control |
CSS with *= in the catalog | Exact TESTID or role with a name |
| A page path with a one-off query | A stable screen path |
| A relative path to a subdomain screen when the run starts on the root | A full catalog-page URL on {slug}.host |
| Locator only on the step across five copies | Repository element + Target binding |
Mixing TEST_ACCOUNT with a page Target | Element or on-step locator for TEST_ACCOUNT |
The repository does not run tests. Execution happens in an autotest run.
Did this page help?