• Labs icon Lab
  • Core Tech
Labs

Guided: Screen Reader Compatibility Testing for Web Accessibility

Sharpen your testing expertise in this Guided Code Lab on screen reader compatibility for web accessibility. Through hands-on tasks, you’ll test and fix accessibility issues in screen reader modes, navigation, graphics, form controls, and dynamic elements. By the end, you’ll be skilled at identifying, analyzing, and resolving accessibility issues to ensure an inclusive user experience.

Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 31m
Published
Clock icon Dec 06, 2024

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Introduction

    Screen reader compatibility is a fundamental aspect of web accessibility, ensuring that individuals with visual impairments or other disabilities can effectively navigate and interact with web content using assistive technologies. This practice fosters inclusivity and enables equal access to digital experiences for all users.


    Scenario

    You are tasked with testing and improving the accessibility of the New User Registration Form for Globomantics.

    The form currently lacks full screen reader compatibility. Your goal is to test the form to ensure it meets accessibility standards and works seamlessly with screen readers, providing a smooth, inclusive experience.

    In this lab, you will conduct accessibility testing for screen reader compatibility and implement necessary improvements to navigation, label associations, interactive elements, and dynamic content updates.


    Before you begin, here are a few key points to keep in mind:

    1. Your main task will be to update the index.html file and record your test observations in the testingReport.txt file.

    2. If you encounter any challenges, feel free to refer to the solution directory for guidance.

    3. After making changes to the code, remember to refresh the Web Browser to view the updates.

    4. To test accessibility, you'll need a screen reader. You can activate it with the following shortcuts:

    • Windows: Windows + Control + Enter
    • Linux: Alt + Windows + S (for the Orca screen reader)
    • Mac: Command + F5
  2. Challenge

    Screen Reader Modes - Browser & Focus Mode

    In this step, you will explore the two primary modes of screen readers Browse Mode and Focus Mode and understand how they impact user navigation and interaction with web content. You will test these modes to see how users with screen readers experience your website.


    Browser Mode:

    Browser Mode is used for exploring and navigating the entire content of a webpage. In this mode, the screen reader reads the page in a linear manner, usually from top to bottom. It can jump between key elements like headings, links, landmarks, and text blocks, providing a comprehensive view of the page's structure.

    Key Features:

    • Content Navigation: Users can read content line by line or jump between major sections (headings, links, landmarks, etc.).
    • Linear Reading: The screen reader reads text sequentially, helping users understand the flow of content.
    • Landmark Navigation: Users can quickly navigate between sections of the page, such as header, footer, and main content using specific keys.
    • No Focus on Interactivity: Unlike Focus Mode, Browser Mode does not prioritize form fields or interactive elements. Instead, it gives an overall understanding of the page structure and content.

    Focus Mode

    Focus Mode is focused on interacting with specific, focusable elements on a webpage, such as links, buttons, and form fields. This mode is designed for situations where a user needs to navigate through and interact with interactive components on the page, like filling out a form or activating a button.

    Key Features:

    • Interaction with Elements: Focus Mode prioritizes interactive elements (links, buttons, form fields) and allows users to interact with them directly.
    • No Linear Reading: Unlike Browser Mode, the content is not read line by line. The user focuses on the next available interactive element.
    • Focus on Navigation: Users can jump between focusable elements (like buttons or form fields) without being distracted by non-interactive content.
    • Immediate Action: Focus Mode is ideal for tasks that require direct interaction, such as submitting forms, clicking buttons, or navigating between links.

    Commonly Used Navigation Keys

    | Element | Key | Details | |---------------------|--------------|-----------------------------------------------------------------------------| | Landmark | D | Navigate to the next ARIA landmark region (e.g., header, main, footer). | | Heading | H | Jump to the next heading in the content. | | Link | K | Navigate to the next link. | | Form Field | F | Navigate to the next form element. | | Button | B | Navigate to the next button. | | Text by Line | Arrow Keys | Move line-by-line through text content. | | Focusable Elements | Tab | Move to the next focusable element like links, buttons, and form fields. |

    To navigate in reverse order, use Shift + with the specified key (e.g., Shift + D for the previous landmark).


    Open the web page in a new window by clicking the Open in new browser tab icon located on the right of the Web Browser tab, and then start your screen reader. In this step, you explored how screen readers function in Browse Mode for page-level navigation and in Focus Mode for interacting with elements. By testing these modes, you gained insight into how users navigate your content and engage with forms.

    Feel free to explore additional keys such as the arrow keys, B, K, and others to navigate through the page. You can also jump between headings by pressing 1 for <h1> headings and 2 for <h2> headings.

    In the next step, you will enhance form controls to improve their accessibility.

  3. Challenge

    Form Controls and Labels Accessibility

    Proper accessibility for form controls and labels ensures that all users, including those relying on assistive technologies like screen readers, can interact effectively with forms. Testing and implementing accessible practices for form controls involve several key considerations.


    Association Between Labels and Controls:

    Use the for attribute in <label> elements to explicitly associate labels with their corresponding form controls. This ensures the screen reader announces the label associated with the input field.

    Example:

    <label for="email">Email Address:</label>
    <input type="email" id="email" name="email">
    ``` Next, you will test the accessibility of the **Gender** radio buttons. ---
    ### Clear and Concise Labels with Contexual Information
    
    It is essential to ensure that fields are accompanied by relevant contextual information, as this helps users fully understand the requirements.
    
    For instance, a form may have an `Age` label, but users might also need to be informed that the age should be entered as a number or text.
    
    ---
    
    Now, you'll update the `Age` label from `Age` to `Age (Number)` . Alternatively you can also add a `aria-label` to input describing contextual information. 
    
    
    
     #### Keyboard Navigation
    
    Test and ensure all form controls are focusable and navigable using the `Tab` key and arrow keys. Ensure non-interactive elements are not part of navigation. 
     In this step, you ensured the form controls and labels are accessible by testing the screen reader announcements, associating labels with inputs using `for`, adding contextual clarity with `aria-label` attributes, and excluding non-interactive elements from navigation using `aria-hidden="true"`.
    
    In the next step, you will test and verify the accessibility of graphic content.
  4. Challenge

    Graphics Content Accessibility

    Ensuring that graphic content is accessible is essential for creating an inclusive user experience, allowing individuals who rely on assistive technologies to understand and interact with visual elements effectively.

    Now you will navigate the page and see how the graphic elements are announced.

    Open the web page in a new tab by clicking on the icon in the Web Browser tab and activate the screen reader. Now that you understand SVG graphics should announce correctly, it's time to address and fix the issue. Just like SVGs, images should be described using the alt attribute.

    Example:

    <img src="image.png" alt="Sunset over a serene beach with palm trees">
    

    Also, to ensure the accessibility of images, make sure there is sufficient color contrast between the graphics and their backgrounds. This helps meet accessibility standards and ensures content is perceivable by all users.


    In this step, you validated graphics content accessibility by testing screen reader announcements for images and SVGs, verifying that the alt attributes or aria-label were correctly applied.

    In the next step, you will test and verify the accessibility of dynamic content.

  5. Challenge

    Dynamic Content Accessibility

    Dynamic content refers to elements on a web page that can change without requiring a page reload, such as updates to text, images, or status indicators. Ensuring accessibility for dynamic content is essential to provide a seamless and inclusive experience for users, especially those using assistive technologies.

    When dynamic content is updated, users relying on screen readers or other assistive technologies may not be notified of the changes unless proper techniques are applied.

    You will validate the New User Registration Form to see if the errors are correctly announced.

    Open the web page in a new tab by clicking on the icon in the Web Browser tab and activate the screen reader.

    In this step, you tested and confirmed that dynamic content updates are correctly announced by the screen reader using the aria-live attribute.

  6. Challenge

    Conclusion and Next Steps

    Conclusion

    In this lab, you have gained hands-on experience with improving screen reader compatibility for the New User Registration Form at Globomantics. By applying best practices for accessibility, you’ve ensured that users with visual impairments can easily navigate and interact with the form using assistive technologies.

    Throughout the lab, you:

    • Explored the differences between screen reader Browse Mode and Focus Mode, and tested how these modes impact navigation.
    • Validated the form’s structure, including headings, landmarks, and accessibility of graphics content, ensuring everything is described appropriately for screen readers.
    • Improved form control accessibility by associating labels correctly with form fields, ensuring that screen readers can announce the labels properly.
    • Implemented dynamic content accessibility, using aria-live to ensure real-time error messages were announced correctly to the user.

    You’ve contributed to creating an inclusive and accessible user experience, making the Globomantics New User Registration Form more usable for everyone, regardless of their abilities.


    Next Steps

    1. Expand Accessibility Testing: Continue improving other forms and sections on your website, ensuring that all interactive elements and content are screen reader compatible.

    2. Explore More ARIA Features: Look into other ARIA attributes, such as aria-labelledby and aria-describedby, to improve the accessibility of other complex UI elements like modals, tabs, or dropdowns.

    3. Cross-Browser and Device Testing: Perform tests on different screen readers, browsers, and devices to ensure consistency in user experience across platforms.

    4. Stay Up to Date with WCAG Guidelines: Keep learning about the latest accessibility standards and best practices from the Web Content Accessibility Guidelines (WCAG), and implement them in your future projects.

    By continuing to practice and applying these concepts, you’ll be able to make significant contributions to the inclusivity and usability of digital experiences.

Amar Sonwani is a software architect with more than twelve years of experience. He has worked extensively in the financial industry and has expertise in building scalable applications.

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.