UI Coverage+ Add-on
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-cy
ordata-test
to the element. - Ignore Dynamic Attributes: Use
attributeFilters
to 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-*
orid
attributes. - 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-cy
ordata-test
values to each element. - Filter generic attributes: Exclude unrepresentative attributes using
attributeFilters
configuration. - Customize attribute use: Update
significantAttributes
configuration 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
id
values, 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-cy
ordata-test
values across similar elements. - Ignore Dynamic Attributes: Configure
attributeFilters
to exclude varying attributes. - Manually Group Elements: Use
elementGroups
configuration 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-cy
ordata-test
values for each element. - Filter Shared Attributes: Exclude generic identifiers with
attributeFilters
configuration. - Update Identification Rules: Adjust
significantAttributes
configuration to improve differentiation. - Manually Separate Groups: Define individual groups using
elementGroups
configuration.