top of page

Shared Page Objects vs. Copy-Paste Locators in Reviewed Automation

Writer: Ashwin Kondapalli
Ashwin Kondapalli
Oct 16
4 min read

Author: Ashwin Kondapalli, Founder & CTO, LoopIQ Updated: October 16, 2026

A release review stalls on one failing checkout test. The fix looks trivial: the "Place order" button got a new label. But the same button is located in nineteen specs, written four different ways, and two of those copies still pass because they match a different element. Nobody can say which tests exercised the real button for the candidate under review. The failure was easy. The evidence question is not.

Shared page objects beat copy-paste locators in reviewed automation because reviewers can check one owned, versioned definition instead of every copy. LoopIQ's own guidance is direct: use Page Object Repositories instead of duplicating locators in generated tests. When an object changes, the change appears once, as a new immutable repository version, with a compare view and an audit trail.

What is the difference between a shared page object and a copy-paste locator?

  • A copy-paste locator is a selector written inline in a test, often duplicated from another test. Each copy can drift on its own.

  • A shared page object is a named object, such as Submit order, defined once and referenced by many tests. In LoopIQ it lives in a Page Object Repository page, with immutable versions.

Why do copy-paste locators weaken release evidence?

Reviewers are not only asking whether tests passed. They are asking whether the tests exercised what the requirement describes, on the candidate being released. Copy-paste locators make that harder:

  1. Review cost grows with every copy. A reviewer has to read each selector to know what a step touched.

  2. Silent divergence. One copy is updated and another still matches an old or wrong element, so it can keep passing.

  3. No change record. An inline edit lives in a diff somewhere, not next to the object it changed.

  4. Unclear ownership. No single person owns "the checkout button".

When is an inline locator acceptable?

Rarely, and on purpose. Reasonable cases include a throwaway exploratory script that will not become an approved asset, or an API test where no browser object exists (Karate API tests do not need browser page objects). Anything that becomes approved automation and feeds release evidence should reference shared objects.

How do you move from copy-paste to shared objects?

  1. Inventory duplicates. List every selector used for the same element.

  2. Capture the page. Use the Page Object Capture extension to capture the route into the right repository and page.

  3. Name by purpose. Rename objects to business-readable names like Customer email or Open approval dialog.

  4. Regenerate or update tests to reference the repository objects, then review the package before approval.

  5. Retire the copies. Treat any inline selector left behind as an open item with an owner.

How this works in LoopIQ

  • Selection at generation: for Playwright or Selenium, you select a Page Object Repository in Generate test coverage, plus one source work item. Generation creates a review-only package in draft status.

  • Review criteria: the help docs list "stable page object references" among the checks for each automation draft, along with specific assertions, correct journey step order, and absence of secrets or sensitive personal data.

  • Approval gates execution: approving a package creates manual cases and draft automation assets. Each asset is approved individually, and only approved assets can join an executable suite or governed execution.

  • One change, one version: each approved capture creates an immutable repository version. Version history shows added or removed objects and locator, attribute, state, and semantic changes. Restoring an older version creates a new version and records an audit event.

  • Evidence: journey evidence can include locator references, page URL, screenshot, and trace for each step.

Comparison matrix

  • Where is the button defined? Copy-paste locators: In every test that uses it · Shared page objects in LoopIQ: One repository page object

  • What changed since last release? Copy-paste locators: Search diffs across specs · Shared page objects in LoopIQ: Compare repository versions

  • Who owns it? Copy-paste locators: Often unclear · Shared page objects in LoopIQ: Repository owner

  • Can a stale copy keep passing? Copy-paste locators: Yes · Shared page objects in LoopIQ: Tests reference the current object

  • Can we roll back? Copy-paste locators: Manual edits · Shared page objects in LoopIQ: Restore as a new immutable version with audit event

Checklist before approving generated automation

  • The package references a Page Object Repository, not inline selectors

  • Object names describe purpose

  • No duplicate objects for the same element on a page

  • Assertions are specific

  • No secrets or personal data in steps or objects

  • Each asset is approved only if the team understands and intends to run it

FAQ: quick answers

Why are duplicated locators a problem in test automation? Each copy can drift independently, so a test may pass against the wrong element, and reviewers must read every copy to know what was exercised.

Does LoopIQ recommend page objects over inline locators? Yes. Its recommended practice is to use Page Object Repositories instead of duplicating locators in generated tests and to capture each application page separately.

How are page-object changes tracked? Each approved capture creates an immutable repository version you can compare and, if needed, restore as a new version with an audit event.

Do shared page objects make a release safe? No. They make tests easier to review and evidence easier to trust. Tests do not authorize release; people decide under policy.

One definition, many tests

See a requirement become reviewed tests and execution evidence in LoopIQ, with every test pointing at shared, versioned page objects. Book a walkthrough: https://meet.brevo.com/ashwin-kondapalli.

General information for engineering, quality, release, and compliance leaders. Not legal, audit, or regulatory advice.

Recent Posts

See All
Page Object Repository Capture from an Existing UI

Inheriting a UI with no page-object layer? Capture meaningful objects from the running app into a versioned Page Object Repository, review every object before upload, and reuse them in reviewed Playwr

 
 
Migrating Playwright Repos Without Orphan Locators

A green Playwright suite can still hide orphan locators: dangling imports, dead page-object members, and drifted inline selectors. Build a locator inventory, consolidate into owned page objects, and m

 
 
bottom of page