Warning:
This wiki has been archived and is now read-only.
SC4-1-1-id
From Automated WCAG Monitoring Community Group
This test belongs to 4.1.1 Parsing.
Status
Contents
Description
This test checks id attribute for all elements to have a unique value.
Background
- H93: Ensuring that id attributes are unique on a Web page
- F77: Failure of Success Criterion 4.1.1 due to duplicate values of type ID
- test F77-1
Assumptions
no known assumptions
Test properties
Property | Possible values |
---|---|
Test name | Define ids for elements |
Test requirement | 4.1.1 Parsing |
Test mode | Automatic |
Test environment | DOM |
Test subject | single web page |
Test procedure
Selector
Test mode:
earl:automatic
Select any element with an id attribute. The following CSS selector could be used: *[id]
Step 1
Test mode:
earl:automatic
- IF there is no list called 'knownIDs':
- Create an empty list 'knownIDs;
- IF the value of the ID attribute exists in 'knownIDs':
- Return SC4-1-1-id-fail1
- ELSE:
- Add the value of the ID attribute of the selected element to 'knownIDs'
- Return SC4-1-1-id-pass1
Property | Value |
---|---|
TestCase | SC4-1-1-id |
Identifier | SC4-1-1-id-pass1 |
Outcome | passed |
Pointer | selector result |
Info |
Property | Value |
---|---|
TestCase | SC4-1-1-id |
Identifier | SC4-1-1-id-fail1 |
Outcome | failed |
ErrorMessage | The ID of this element has occurred before on this page |
Pointer | selector result |
Info |