CLASSIFIED DOCUMENTATION & TROUBLESHOOTING

FlowMacro Knowledge Base

Organized architecture guides, selector waterfall specifications, zero-trust cryptographic secrets, and pragmatic fixes for real-world automation edge cases.

01
Category: System Design

System Architecture & Zero-Backend Engine

1. Dedicated IDE Controller

Opens as an isolated 960 × 750px window via chrome.windows.create(popup). Controls target browser tabs via message passing without injecting heavy UI frames into target websites.

Focus: Zero DOM interference with target app
2. Manifest V3 Service Worker

Operates with dual-tier state persistence (chrome.storage.session & chrome.storage.local). Survives browser service worker suspension and rehydrates execution seamlessly.

Lifecycle: Rehydration on every message & tab update
3. 100% Client-Side Storage

Recorded workflows, test suites, and cryptographic keys remain strictly on your local device. FlowMacro does not operate any remote database, proxy servers, or third-party telemetry beacons.

Compliance: Zero cloud exposure, GDPR/HIPAA-safe

Manifest V3 Permission Declarations:

activeTab & tabs: Attaches recorder/replayer content scripts into the specific tab you target.
scripting: Dynamically injects recorder.js and replayer.js upon page navigation.
storage & session: Persists your test suites and active recording heads locally across reloads.
webNavigation: Detects top-level redirects and hash transitions (#/factor-one) to re-attach listeners.
02
Category: Getting Started

Quick Start: Your First Automation in 60s

1Open Controller Window

Click the FlowMacro icon in your Chrome toolbar or hit Alt + Shift + R. The standalone controller window launches and establishes connection with your browser tab.

Controller size: 960 × 750px popup
2Specify URL & Record

Enter your target starting URL in the BASE_URL field and click Record. Navigate and click elements naturally. Actions stream into the table in real time.

Passwords masked automatically in memory
3Replay, Tune & Export

Hit Stop when finished. Click Replay Macro to test execution at 0.5x, 1x, or 2x speed. Export to Playwright (TS), Puppeteer (JS), or Python Selenium.

Green outline confirms target element
Pro-Tip for Fast Iteration: You can click any step in the IDE table and click "Play from here" to resume execution from a specific step without having to replay the entire macro from the beginning.
03
Category: Core Automation Engine

The 5-Tier Selector Waterfall & DOM Piercing

Most web recorders fail in production because they rely on fragile CSS selectors like div.css-19f8x > button.btn-3a. FlowMacro resolves this with an intelligent multi-tier locator hierarchy evaluated at capture time:

Tier 0

Open Shadow DOM Piercing (composedPath)

Uses composedPath() and recursive shadow host inspection. When an element lives inside a Web Component shadow root, FlowMacro emits deep piercing locators like shadow=host-component >>> inner-button.

Tier 1

QA & Test Attributes (data-testid)

Checks for data-testid, data-test, data-cy, and data-qa. Resilient against any styling or DOM tree redesign.

Tier 2

Semantic ID Filter (Regex Discard Engine)

Employs regex filters to eliminate autogenerated framework IDs like :r0: (React 18), ember1284, radix-id-12, and 4+ digit numeric hashes, preserving only stable IDs like #identifier-field.

Tier 3

Semantic ARIA & Accessible Roles

Captures [aria-label="Sign In"], [role="button"], and input [placeholder="..."].

Tier 4

Semantic Element & Button Text

Generates text-based locators such as xpath=//button[normalize-space()="Continue"] or css=button[type="submit"].

Tier 5

Sanitized CSS & Structural XPath Fallback

Generates hierarchical CSS with automatic emoji stripping (removing Clerk's .🔒️ classes) and standard structural XPath as a final resilience layer.

Cross-Origin Iframe Routing: FlowMacro tracks the exact frameId from message senders. Commands recorded inside embedded payment frames (Stripe, PayPal) dispatch directly into the matching frame during replay.
04
Category: Security & Compliance

Zero-Trust Credential & Secret Vault

Brittle / Legacy Macro Tools

Hardcode plain-text passwords into exported JSON files or scripts. Committing these files to Git or sharing them with teammates creates instant credential leak vulnerabilities.

FlowMacro In-Memory Vault

Masks sensitive fields as {{SECRET_PASSWORD}} and encrypts secrets in memory via native AES-256-GCM (Web Crypto API).

How Cryptographic Secrets Work Under the Hood:

1. DetectionDetects type="password", autocomplete="current-password", and inputs with tokens like secret|token|api_key.
2. 96-bit Nonce GCMGenerates a cryptographically random 96-bit initialization vector (crypto.getRandomValues) with client-side 256-bit symmetric keys.
3. CI/CD Environment ExportExports generate clean references to process.env.AUTO_MACRO_PASSWORD so tests execute headlessly in GitHub Actions with zero leaks.
// Secure Playwright Export - Zero Hardcoded Passwords
const AUTO_MACRO_PASSWORD = process.env.AUTO_MACRO_PASSWORD || '';

// Step: TYPE id=password-field
await page.locator("#password-field").fill(AUTO_MACRO_PASSWORD);
05
Category: Problem Solving

Troubleshooting & Real-World Edge Cases

Real-world web applications (especially modern authentication providers like Clerk, Supabase, Auth0, and NextAuth) introduce dynamic DOM states. Here is how to diagnose and resolve each scenario:

Edge Case 1: Two-Screen Login Forms & Ghost "SUBMIT" Steps

Modern auth widgets split sign-in across two screens (Screen 1: enter email → click Continue → Screen 2: enter password → click Sign In). When clicking "Continue", form libraries often emit both a button click and a form submit, recording redundant SUBMIT steps before Screen 2 appears.

The Clean Solution:

In the FlowMacro IDE table, review your recorded steps. Simply click the Trash icon on any ghost SUBMIT steps between the username click and the password input. A clean multi-step flow should look like:

1. TYPE: id=identifier-field (e.g. username/email)
2. CLICK: button.cl-formButtonPrimary (Continue)
3. TYPE: id=password-field ({{SECRET_PASSWORD}})
4. CLICK: button.cl-formButtonPrimary (Sign In)
Edge Case 2: "Target not found in DOM within 6000ms"

Occurs when an element takes longer than 6 seconds to render due to network latency, lazy chunk loading, or modal transitions.

Fix A: Switch Waterfall Selector

Click the failed step in the table. In the Command Inspector, switch from the CSS path to an alternate ARIA locator or ID.

Fix B: Add a Brief Pause Step

Click + Add Step in the IDE and choose wait (e.g. 1500ms) right before the slow element to give the SPA time to render.

Edge Case 3: Reordering or Updating Recorded Steps

Never discard an entire recording if you clicked something by accident. Use the ↑ Up and ↓ Down arrows on any step row to reorder actions, or select a step to adjust its command type, selector, or value directly in the Command Inspector.

06
Category: Integration & CI/CD

Multi-Framework Code Exporters & CI/CD

Playwright (TS)

Async TypeScript tests with page.locator() and environment variables.

Puppeteer (JS)

Vanilla Node.js scripts for headless scraping and browser workflow verification.

Python Selenium

WebDriver scripts utilizing WebDriverWait and ChromeOptions.

Selenium IDE (.side)

Interchangeable JSON schema compatible with Selenium IDE runners.

Automated CI/CD Workflow (.github/workflows/playwright.yml):

name: FlowMacro Playwright CI
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npx playwright install --with-deps
      - run: npx playwright test
        env:
          AUTO_MACRO_PASSWORD: ${{ secrets.AUTO_MACRO_PASSWORD }}
07
Category: Developer Quick Reference

Command & Keyboard Shortcuts Reference

Supported Selenium Commands

openNavigates to URL & waits for DOM ready
clickClicks target element (with 5-tier fallback)
typeInputs text value (auto-masked if sensitive)
selectSelects dropdown option (label= or value=)
submitSubmits parent form or triggers Enter
waitForPolls until target element becomes visible
waitFixed duration delay (e.g. 1500ms)

IDE Keyboard Shortcuts

Undo ActionCtrl + Z
Redo ActionCtrl + Y / Ctrl + Shift + Z
New Test SuiteCtrl + N
Open / Import JSON SuiteCtrl + O
Open Code Export ModalCtrl + E
Launch Controller IDEAlt + Shift + R
Direct Developer Assistance

Need Help or Found an Edge-Case Website?

Have an unusual form, shadow DOM obstacle, or feature request? We actively monitor support inquiries and provide hands-on assistance.