Papio Framework Generator

Published: (March 14, 2026 at 01:03 AM EDT)
2 min read
Source: Dev.to

Source: Dev.to

If you’ve spent time in test automation, you know the selector problem. You open DevTools, inspect an element, and then manually craft something like:

@class='container']//button[contains(text(),'Submit')]

Two sprints later, the UI changes. The class is gone. The test breaks. You fix it. The cycle repeats indefinitely.

After 20+ years in QA automation — working across Toyota Connected, Caesars Digital, and enterprise Fortune 500 environments — I decided to build the tool I always wished existed: Papio Selector.

The Core Problem: Framework Fragmentation

Each framework has its own selector API. Maintaining consistency across all of them manually is error‑prone and time‑consuming. Papio generates idiomatic code for all of them from a single inspection.

Shadow DOM — The Elephant in the Room

Papio handles Shadow DOM elements automatically, ensuring selectors work even when components are encapsulated.

Selector Priority Algorithm

Papio follows a prioritized approach to generate the most stable selectors:

  1. data-testid / data-cy attributes (most stable)
  2. ARIA roles and labels
  3. ID attributes
  4. Unique CSS class combinations
  5. Structural/positional selectors (last resort)

This means Papio‑generated selectors are inherently more resilient to UI changes than manually crafted ones.

Install & Try It

Papio Test Framework Generator – Chrome Web Store

0 views
Back to Blog

Related posts

Read more »