Facebook

How CloudQA Automated Shopify–AdNabu Workflows Despite MFA and Shadow DOM

At a Glance

Client: AdNabu (Shopify app for product feed and catalog automation)

Challenge: Building repeatable, unattended end-to-end automation for Shopify–AdNabu workflows despite session timeouts, MFA prompts, Shadow DOM elements, and a UI that changes frequently.

Approach: A dedicated, isolated execution environment paired with session persistence and resilient, self-healing selector logic.

Outcome: Stable, unattended automation of core Shopify–AdNabu workflows — product creation, variants, images, pricing, Google Feed sync, and AI-generated descriptions — without manual re-authentication or constant test maintenance

Table of Contents

The Challenge

Shopify is one of the more difficult platforms to automate reliably, and not for the reasons most teams expect. The functional logic of creating a product or syncing a feed isn’t complex — the difficulty is everything surrounding it. Automating Shopify–AdNabu workflows meant solving four separate problems before a single meaningful test could run consistently:

Session timeouts. Long-running or scheduled automation needs a session that’s still valid when it executes. Shopify sessions expire, and an automation suite that has to log in fresh every run is both slower and more fragile — every login attempt is another point of failure.

MFA prompts. Multi-factor authentication is essential for account security, but it’s specifically designed to interrupt automated, unattended access. A test suite that hits an MFA challenge mid-run doesn’t just fail that test — it stalls the entire pipeline behind it.

Shadow DOM complexity. Shopify’s admin interface, like many modern web apps, uses Shadow DOM to encapsulate component internals. Elements inside a shadow root aren’t visible to standard DOM queries the way regular page elements are, which means conventional selector strategies simply can’t see — let alone interact with — a meaningful portion of the UI.

Frequent UI changes. Shopify ships product and interface updates on its own schedule, not the testing team’s. Automation built around brittle, single-attribute selectors breaks every time an element’s underlying markup shifts, even when nothing about the actual user-facing behavior has changed.

Individually, any one of these is manageable. Together, they made stable, repeatable, unattended automation genuinely difficult — which is what the project needed to solve for.

The Solution

A Dedicated, Isolated Execution Environment

Rather than running Shopify–AdNabu automation alongside other test suites on shared infrastructure, we configured a dedicated virtual machine specifically for this workflow. Isolating the environment removed an entire category of flaky-test causes — resource contention, state bleed from unrelated test runs, and configuration drift from other projects sharing the same machine. The VM’s configuration, browser state, and session data belong exclusively to Shopify–AdNabu automation, which makes failures far easier to diagnose: if something breaks, it’s a Shopify–AdNabu issue, not an artifact of something unrelated running at the same time.

Solving Login and MFA With a Persistent Debugger Profile

Instead of attempting to script around MFA on every run — an approach that’s both fragile and, for many MFA implementations, not reliably automatable at all — we used a dedicated Chrome Debugger Profile to retain an already-authenticated Shopify session. The browser profile persists its login state between runs, so the automation connects to a session that’s already past the MFA challenge rather than triggering a new one each time.

This approach solves the session-timeout problem and the MFA problem with the same mechanism: as long as the profile’s session remains valid, tests execute against a live, authenticated Shopify instance with no login step required at all.

Handling Shopify’s Shadow DOM

Where standard selector strategies couldn’t reach into Shopify’s Shadow DOM elements, we built a custom solution specifically for piercing shadow roots and interacting with the elements inside them. This meant identifying which parts of the Shopify admin interface use Shadow DOM, and building selector and interaction logic that traverses into those shadow trees rather than stopping at the host element. The result is automation that can reliably click, type into, and read values from elements that would otherwise be invisible to the test framework entirely.

Self-Healing Selector Logic

To handle Shopify’s frequent UI updates without constant manual test maintenance, we implemented fallback and self-healing selector logic that identifies elements using multiple properties rather than a single brittle reference. When a primary selector no longer matches — because an attribute changed, an ID shifted, or the markup was restructured — the automation falls back to alternate identifying properties to locate the same functional element, rather than failing outright.

This shifts the maintenance burden: instead of a human noticing a broken test, diagnosing which selector failed, and manually updating it, the automation absorbs routine UI churn on its own. Genuine behavioral changes still surface as real failures — the goal isn’t to hide problems, it’s to stop cosmetic changes from being mistaken for them.

Automating the Core Shopify–AdNabu Workflows

With a stable environment, persistent authentication, and resilient selectors in place, we automated the workflows that actually matter to AdNabu’s product:

  • Product creation — building new product listings end-to-end
  • Variants — creating and managing product variants (size, color, and other option combinations)
  • Images — uploading and associating product imagery
  • Pricing — setting and updating pricing data
  • Google Feed sync — verifying that product data correctly syncs to the Google Shopping feed
  • AI-generated descriptions — validating AI-produced product description content within the workflow

Because these workflows involve asynchronous operations — image uploads, feed syncs, and AI generation all complete on their own timelines rather than instantly — the automation uses dynamic waits rather than fixed sleep intervals, so tests proceed as soon as an operation genuinely completes instead of on a guessed timer.

The Outcome

The combination of an isolated environment, persistent authentication, Shadow DOM handling, and self-healing selectors turned a workflow that was previously difficult to automate reliably into a suite that runs unattended and stays stable through Shopify’s routine UI updates. The core commercial workflows AdNabu depends on — from product creation through Google Feed sync — are now covered by automation that doesn’t require manual re-login, doesn’t stall on MFA, and doesn’t need constant selector rewrites every time Shopify ships a UI change.

Key Takeaways

  • Isolate before you optimize. A dedicated environment eliminates an entire class of flaky-test causes before any selector or workflow logic is even written.
  • Solve authentication once, not every run. Persisting an authenticated session through a debugger profile removes login and MFA as a per-execution failure point.
  • Shadow DOM needs a deliberate strategy, not a workaround. Standard selectors can’t see into shadow roots — plan for it rather than discovering it mid-project.
  • Self-healing selectors buy time, not immunity. They absorb cosmetic UI churn so the team’s attention goes to real behavioral changes instead of routine maintenance.

Share this post if it helped!

RECENT POSTS
Guides
Price-Performance-Leader-Automated-Testing

Switching from Manual to Automated QA Testing

Do you or your team currently test manually and trying to break into test automation? In this article, we outline how can small QA teams make transition from manual to codeless testing to full fledged automated testing.

Agile Project Planing

Why you can’t ignore test planning in agile?

An agile development process seems too dynamic to have a test plan. Most organisations with agile, specially startups, don’t take the documented approach for testing. So, are they losing on something?

Testing SPA

Challenges of testing Single Page Applications with Selenium

Single-page web applications are popular for their ability to improve the user experience. Except, test automation for Single-page apps can be difficult and time-consuming. We’ll discuss how you can have a steady quality control without burning time and effort.