QAID Docs

Element Extraction

Element extraction is part of the Discovery step. It extracts interactive elements from your discovered pages.

Overview

Element Extraction visits each page and identifies interactive elements:

  • Buttons and links
  • Form inputs (text, email, password, etc.)
  • Select dropdowns
  • Checkboxes and radio buttons
  • Textareas
  • Embedded iframes with forms

Running Element Extraction

Starting Extraction

  1. Navigate to the Discovery step (Pages)
  2. Ensure pages have been discovered (status shows page count)
  3. Click "Extract Elements"
  4. Wait for the job to complete

Understanding Elements

Element Types

TypeDescriptionExamples
linkClickable linksNavigation, external links
buttonAction buttonsSubmit, cancel, toggle
inputText inputsName, email, search
selectDropdown menusCountry picker, filters
checkboxToggle optionsTerms acceptance
radioSingle-select optionsPayment method
textareaMulti-line textMessage, comments

Element Importance

QAID classifies elements by importance:

LevelMeaningExample
PrimaryCore functionalitySubmit button, main navigation
SecondarySupporting featuresSecondary actions, filters
TertiaryMinor interactionsSocial links, minor toggles

Selectors

Each element has multiple selector strategies:

  1. Role-based (preferred): getByRole('button', { name: 'Submit' })
  2. Test ID: getByTestId('submit-btn')
  3. Label: getByLabel('Email Address')
  4. CSS: button.submit-button

QAID prefers role-based selectors for stability.

Viewing Elements

Statistics Dashboard

The Elements step shows aggregate statistics:

  • Total elements discovered
  • Breakdown by type (with counts)
  • Breakdown by importance
  • Quality issues found

View Modes

By Type Groups elements by their type (link, button, input, etc.). Each group shows:

  • Type icon and count
  • Expandable list of elements
  • Element details on hover

By Page Groups elements by their source page:

  • Page URL as header
  • Elements listed under each page
  • Useful for page-specific analysis

Filtering Elements

Use filters to find specific elements:

FilterOptions
TypeAll, Link, Button, Input, etc.
ImportanceAll, Primary, Secondary, Tertiary
SearchText search across element labels

Element Details

Click an element to see:

  • Label/Text: Visible text on the element
  • Type: Element type
  • Importance: Primary/Secondary/Tertiary
  • Selectors: All generated selectors
  • Page: Source page URL
  • Attributes: HTML attributes

Quality Issues

The Quality Issues tab shows problems detected during extraction:

Issue Types

IssueDescriptionImpact
Missing Alt TextImages without alt attributesAccessibility
Missing LabelsForm inputs without labelsAccessibility, Testability
Duplicate IDsMultiple elements with same IDSelector reliability
Broken LinksLinks pointing to 404 pagesUser experience
Empty ButtonsButtons with no text/labelAccessibility

Reviewing Issues

  1. Click the Quality Issues tab
  2. Issues are grouped by page
  3. Each issue shows:
    • Issue type
    • Affected element
    • Recommendation
  4. Use this to improve your application

Iframe Handling

QAID detects and extracts elements from iframes:

Supported Iframes

  • Same-origin iframes
  • Named iframes
  • HubSpot forms
  • Embedded widgets

Cross-Origin Limitations

Some iframes cannot be scanned:

  • Different domain without CORS headers
  • Sandboxed iframes
  • Third-party payment forms

Re-running Extraction

You can re-run extraction at any time:

  1. Click "Extract Elements" again
  2. QAID compares with existing elements:
    • New elements are added
    • Changed elements are updated
    • Missing elements are marked for review

When to Re-run

  • After adding new pages
  • When your site UI changes
  • After significant code deployments
  • When element tests fail unexpectedly

Exporting Elements

Export element data for external analysis:

  1. Click "Export"
  2. Choose format (CSV, JSON)
  3. Download the file

Export includes:

  • All element details
  • Selectors
  • Page associations
  • Importance classifications

Best Practices

Before Extraction

  • Complete page discovery first
  • Blacklist pages you don't want to test
  • Configure authentication if needed

Improving Element Quality

  • Add data-testid attributes to key elements
  • Use semantic HTML (<button>, <nav>, <main>)
  • Ensure proper form labels
  • Avoid generic class names

Managing Large Element Sets

  • Use filters to focus on specific types
  • Prioritize Primary importance elements
  • Review Quality Issues and fix underlying problems

Troubleshooting

Elements Not Being Detected

Possible causes:

  • Element is in Shadow DOM (not supported)
  • Element appears after complex user interactions
  • Element is hidden until scrolled into view

Solutions:

  • QAID automatically detects and expands dropdown menus during crawling
  • Runtime element discovery handles menus/tabs during test execution
  • Use recording feature to capture complex interactive sequences
  • Check if element is in a cross-origin iframe
  • Verify element is visible on page load or behind a simple menu

Wrong Selectors Generated

Symptoms:

  • Tests fail with "element not found"
  • Multiple elements match selector

Solutions:

  • Add unique data-testid attributes
  • Use more specific HTML structure
  • Check for duplicate elements

Missing Form Elements

Check:

  • Is the form in an iframe?
  • Does the form require JavaScript to render?
  • Is authentication required to see the form?

On this page