UI CoveragePremium Solution
Troubleshooting
A single element appears as multiple elements​
When a single element is identified as multiple distinct elements in UI Coverage, it may indicate an issue with Element Identification. This often occurs due to:
- Auto-generated or dynamic attributes (e.g., UUIDs) that differ across snapshots.
- Library-specific identifiers, such as id attributes generated by frameworks.
Solutions​
- Add Unique Identifiers: Assign a stable identifier like data-cyordata-testto the element.
- Ignore Dynamic Attributes: Use attributeFiltersto exclude attributes that change across tests.
- Manually Configure Identification: Use elements configuration to explicitly define how the element should be identified.
Multiple different elements are identified as the same​
If different elements are being grouped as one in UI Coverage, this could be due to insufficient or non-specific identifiers, such as:
- Missing unique data-*oridattributes.
- Generic identifiers like data-test="button"shared across multiple elements.
- Use of attributes not prioritized by UI Coverage, like aria-label.
Solutions​
- Add unique identifiers: Assign distinct identifiers like data-cyordata-testvalues to each element.
- Filter generic attributes: Exclude unrepresentative attributes using attributeFiltersconfiguration.
- Customize attribute use: Update significantAttributesconfiguration to prioritize relevant identifiers.
- Manually Identify Elements: Use elements configuration to specify how elements should be identified.
Similar elements are not grouped together​
If elements performing the same action are not grouped, it may be due to:
- Library-specific identifiers, like dynamic idvalues, are not representative of the element and prevent grouping.
- Identifiers that include dynamic data, such as UUID's
Solutions​
- Use Shared Identifiers: Apply consistent data-cyordata-testvalues across similar elements.
- Ignore Dynamic Attributes: Configure attributeFiltersto exclude varying attributes.
- Manually Group Elements: Use elementGroupsconfiguration to define custom groupings.
Different elements are incorrectly grouped together​
If unrelated elements are grouped, it may be due to overly generic identifiers or shared attributes. Some common examples of this include:
- Missing unique attributes that could distinguish the elements.
- Generic values like data-test="button"shared across different elements.
Solutions​
- Add Distinct Identifiers: Use unique data-cyordata-testvalues for each element.
- Filter Shared Attributes: Exclude generic identifiers with attributeFiltersconfiguration.
- Update Identification Rules: Adjust significantAttributesconfiguration to improve differentiation.
- Manually Separate Groups: Define individual groups using elementGroupsconfiguration.