I am seeking to automate the process of conducting website accessibility checks by analyzing the color contrast between the focused element (after pressing tab) and its border color.
Strategy:
- Initially, I attempted to take screenshots of the entire website before and after pressing tab.
- Subsequently, I utilized computer vision for image comparison and cropping the differences. However, this method proved ineffective on websites with dynamically changing content.
Upon discovering Chrome's built-in functionality of highlighting the focused element with a blue/orange/white border upon tab press to improve user accessibility, I am now exploring the possibility of achieving this through HTML source code instead of relying on image comparison.
The images below display Chrome adding a white border over the focused element while the background color remains green.