Sc4 1 1 Id
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
- eGovMon test F77-1
Assumptions
no known assumptions
Test properties
| Property | Value |
|---|---|
| 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: automatic
Select any element with an id attribute. The following CSS selector could be used: *[id]
Step 1
Test mode: 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
| Outcome | Passed |
|---|---|
| Testcase | SC4-1-1-id |
| Pointer | selector result |
| ID | SC4-1-1-id-pass1 |
| Outcome | Failed |
|---|---|
| Testcase | SC4-1-1-id |
| Error | The ID of this element has occurred before on this page |
| Pointer | selector result |
| ID | SC4-1-1-id-fail1 |