Link types

Collect every link on the page, then check which ones respond with an error status.

#linkList aa[href]//a[contains(text(),'Broken')]
Use the buttons, or write a test that checks each href.

Images

A broken image has naturalWidth === 0 once loading has finished.

#validImage#brokenImageimg[alt]
Valid logo image
Valid image
Broken image
Broken image
Lazy loaded image
Lazy-loaded image